fragment-transitions

Send data to fragment with FragmentTransaction

為{幸葍}努か 提交于 2020-05-11 05:58:28
问题 I'm in my fragment class calling this: @OnClick(R.id.blockedLinkLayout) public void onBlockedClick(){ final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content, new SettingsBlockedUsersFragment(), FRAGMENT_TAG); ft.commit(); } And it just replace my current fragment with chosen one. And my question is, how can I send some data (e.g. String value) from my parent fragment to my child fragment using FragmentTransaction? 回答1: Just pass them in a bundle as

Send data to fragment with FragmentTransaction

天大地大妈咪最大 提交于 2020-05-11 05:56:31
问题 I'm in my fragment class calling this: @OnClick(R.id.blockedLinkLayout) public void onBlockedClick(){ final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content, new SettingsBlockedUsersFragment(), FRAGMENT_TAG); ft.commit(); } And it just replace my current fragment with chosen one. And my question is, how can I send some data (e.g. String value) from my parent fragment to my child fragment using FragmentTransaction? 回答1: Just pass them in a bundle as

Send data to fragment with FragmentTransaction

 ̄綄美尐妖づ 提交于 2020-05-11 05:51:20
问题 I'm in my fragment class calling this: @OnClick(R.id.blockedLinkLayout) public void onBlockedClick(){ final FragmentTransaction ft = getFragmentManager().beginTransaction(); ft.replace(R.id.content, new SettingsBlockedUsersFragment(), FRAGMENT_TAG); ft.commit(); } And it just replace my current fragment with chosen one. And my question is, how can I send some data (e.g. String value) from my parent fragment to my child fragment using FragmentTransaction? 回答1: Just pass them in a bundle as

Fragment ReenterTransition not working. Need help clarifying the various Fragment transitions

半城伤御伤魂 提交于 2019-12-23 08:51:23
问题 I am implementing Fragment transition animations between items in a RecyclerView, and a Fragment showing details of the clicked item. In other words the relatively common... "Click on a Card in a list and it expands to a detailed view while the rest of the list disappears" ...kind of thing. The transition from the RecyclerView item to the detailed view is working fine. The shared elements of the item are transitioning to their new state while the rest of the RecyclerView items fade away.

fragment to fragment animation with shared element don't work as expected

寵の児 提交于 2019-12-18 09:38:18
问题 In an AppCompatActivity with a RecyclerView in a fragment ( myFragment1 ), viewholders and so on, so if I click on an item, then myFragment2 will show and display the detail of the item. In this phase, I want to create an animation between the two fragments with shared elements. Steps to reproduce the behaviour: import android.view.View; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx

Return transition not working correctly when using fragment shared transitions

我怕爱的太早我们不能终老 提交于 2019-12-10 12:29:17
问题 I have 2 fragments ListMovieFragment and DetailMovieFragment . I have an interface in ListMovieFragment that is implemented in the MainActivity . I am using shared element transition ; when I click the image view in ListMovieFragment the onMovieSelected is called in the MainActivity . Transitioning from the ListMovieFragment works. But when I click the back button, transitioning from the DetailMovieFragment to the ListMovieFragment fails to work. Here is the MainActivity. I think I have got

shared element transition works with FragmentTransaction.replace() but doesn't work with FragmentTransaction.add()

纵然是瞬间 提交于 2019-11-30 04:41:56
The new Shared Element Transitions works when i use Fragment ' replace ' but i can't seem to make it work fragment ' add '. I use the same container in both the cases. More details: Activity - layout-> <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00ffff" android:orientation="vertical" > </FrameLayout> On launch of the Activity, I add Fragment1 to the screen getFragmentManager().beginTransaction().replace(R.id

shared element transition works with FragmentTransaction.replace() but doesn't work with FragmentTransaction.add()

时间秒杀一切 提交于 2019-11-29 02:29:35
问题 The new Shared Element Transitions works when i use Fragment ' replace ' but i can't seem to make it work fragment ' add '. I use the same container in both the cases. More details: Activity - layout-> <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00ffff" android:orientation="vertical" > </FrameLayout> On

Shared elements animating between fragments

那年仲夏 提交于 2019-11-28 16:25:31
I'm trying to animate 2 simple Views from a selected item in a RecyclerView to a new fragment. I've looked at a lot of examples of animating shared elements from one Activity to another Activity, but very few examples of animating a shared element from one Fragment to another Fragment within the same Activity. It almost works. Here is my structure. Activity -- Full screen Fragment1 with RecyclerView -- Full screen Fragment2 with details When the user selects an item in the RecyclerView in Fragment1, I replace Fragment1 with Fragment2 that has a View with the shared elements in it in different

How to postpone a Fragment's enter transition in Android Lollipop?

给你一囗甜甜゛ 提交于 2019-11-28 06:55:41
In Android Lollipop, the Activity#postponeEnterTransition() and Activity#startPostponedEnterTransition() methods give the Activity the ability to delay starting the entering and exiting shared element transitions until all data is loaded. These work great for Activity transitions. Is there a way to achieve the same effect when using Fragment transitions? There's no direct equivalent in Fragment Transitions because Fragments use FragmentTransaction and we can't really postpone something that is supposed to happen in a transaction. To get the equivalent, you can add a Fragment and hide it in a