I have an issue with Shared Element Transition. When I return to MainActivity from DetailActivity, FAB blinking Gif example
I used this sample project. For shared element transition I made:
- Enabled Window Content Transitions in styles.xml
<item name="android:windowContentTransitions">true</item>
- Assign a common transition name to the shared elements in both layouts.
android:transitionName="image"
- Started the target activity by specifying a bundle of those shared elements and views from the source
holder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Context context = v.getContext(); Intent intent = new Intent(context, CheeseDetailActivity.class); intent.putExtra(CheeseDetailActivity.EXTRA_NAME, holder.mBoundString); MainActivity activity = (MainActivity) context; ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, new Pair<>(holder.mView.findViewById(R.id.avatar), "image")); ActivityCompat.startActivity(context,intent, options.toBundle()); } });
And when i press back button, FAB from detail Activity blinks in Main activity.
I did not find a similar problem, so thanks for any help!