Прежде всего, каким бы видом вы ни хотели поделиться из Первого занятия во Второе занятие, добавьте это свойство в представление android:transitionName="logo"
Например, ImageView из первого занятия
<ImageView
android:id="@+id/imgLogo"
android:transitionName="logo"
android:src="@drawable/logo"
android:layout_centerInParent="true"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_width="400dp"
android:layout_height="150dp" />
НачалоВторое действие, подобное этому
final ImageView imgLogo = (ImageView) findViewById(R.id.imgLogo);
Intent intent = new Intent(SplashScreen.this,Login.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(SplashScreen.this, imgLogo, "logo");
startActivity(intent, options.toBundle());
}else {
startActivity(intent);
}
Затем во втором упражнении снова укажите то же имя перехода к соответствующему представлению
<ImageView
android:id="@+id/imgLogo"
android:transitionName="logo"
android:src="@drawable/logo"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_width="200dp"
android:layout_height="100dp" />
Вот и все !!!