There is a GridView with photos. When you click on the item, this photo should move to the second activity. Here is the article that I did - https://guides.codepath.com/android/Shared-Element-Activity-Transition . But the desired effect. enter image description here

I can not. No transition animation. I don’t know what to think, so here’s all the code.

gridview_item.xml

 <ru.albatros.material.ItemSquare xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/grid_iv" android:clickable="true" android:scaleType="centerCrop" android:transitionName="photo" /> </ru.albatros.material.GridViewSquare> 

profile.xml

 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#cccccc" android:fitsSystemWindows="false"> <android.support.design.widget.AppBarLayout android:id="@+id/main_appbar_x" android:layout_width="match_parent" android:layout_height="300dp" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:fitsSystemWindows="false"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/mcollapsing" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollFlags="scroll|exitUntilCollapsed" android:fitsSystemWindows="true" app:contentScrim="#831296"> <ImageView android:id="@+id/grid_iv" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:fitsSystemWindows="true" android:transitionName="photo" app:layout_collapseMode="parallax"/> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="60dp" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:layout_collapseMode="pin"/> </android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" android:layout_margin="10dp" app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

  <android.support.design.widget.FloatingActionButton android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_margin="10dp" android:src="@drawable/fabrandom" app:layout_anchor="@id/main_appbar_x" app:layout_anchorGravity="bottom|right|end"/> </android.support.design.widget.CoordinatorLayout> 
  • And what device are you checking on? In the article, the recipe is only for api 21 and higher - pavel163
  • I know) Marshmallow is mine - Flippy

0