Transition from Android hacking does not explode GridView

I am trying to use a transition by switching to the generated mesh mode. However, the only thing that flies off radially is the floating button at the bottom of the screen. GridView cells move as a unit. How to make these cells "explode"?

Here is my style.xml :

 <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> <item name="colorControlActivated">@color/colorAccent</item> <item name="colorControlHighlight">@color/colorAccent</item> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <!-- Animation items --> <item name="android:windowActivityTransitions">true</item> <item name="android:windowContentTransitions">true</item> <item name="android:windowEnterTransition">@android:transition/fade</item> <item name="android:windowExitTransition">@android:transition/explode</item> </style> </resources> 

Here is the onCreate GridView activity I'm trying to detonate:

 protected void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS); super.onCreate(savedInstanceState); getWindow().setExitTransition(new Explode()); setContentView(R.layout.activity_main); 

Alternatively, if you know examples containing GridView explode transitions, feel free to post them.

+6
source share
2 answers

GridView works as a single element, if you need each of its elements to move in different directions - you need to configure the animation for each element depending on its position and start all of them when exiting before starting the main exit animation.

+3
source

The place of the GridView where you can use recyclerview allows you to achieve both the gridview view and the list, as well as easily translate the view.

http://www.androidhive.info/2016/01/android-working-with-recycler-view/

http://developer.android.com/reference/android/support/v7/widget/RecyclerView.html

0
source

All Articles