2
我想制作一个包含项目列表的应用程序。当用户点击一个项目时,我想用动画效果为其制作动画效果hereAndroid材质设计 - 材质动作
是android库包含它原生?如果没有,这个动画是否有一个3方图书馆?
你可以看到在这个视频动画: video link
我想制作一个包含项目列表的应用程序。当用户点击一个项目时,我想用动画效果为其制作动画效果hereAndroid材质设计 - 材质动作
是android库包含它原生?如果没有,这个动画是否有一个3方图书馆?
你可以看到在这个视频动画: video link
您可以使用共享元素过渡
https://github.com/codepath/android_guides/wiki/Shared-Element-Activity-Transition
https://github.com/googlesamples/android-ActivitySceneTransitionBasic
https://github.com/toddway/MaterialTransitions
https://github.com/afollestad/shared-element-transition-samples
FirstFragment fragmentOne = ...;
SecondFragment fragmentTwo = ...;
// Check that the device is running lollipop
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// Inflate transitions to apply
Transition changeTransform = TransitionInflater.from(this).
inflateTransition(R.transition.change_image_transform);
Transition explodeTransform = TransitionInflater.from(this).
inflateTransition(android.R.transition.explode);
// Setup exit transition on first fragment
fragmentOne.setSharedElementReturnTransition(changeTransform);
fragmentOne.setExitTransition(explodeTransform);
// Setup enter transition on second fragment
fragmentTwo.setSharedElementEnterTransition(changeTransform);
fragmentTwo.setEnterTransition(explodeTransform);
// Find the shared element (in Fragment A)
ImageView ivProfile = (ImageView) findViewById(R.id.ivProfile);
// Add second fragment by replacing first
FragmentTransaction ft = getFragmentManager().beginTransaction()
.replace(R.id.container, fragmentTwo)
.addToBackStack("transaction")
.addSharedElement(ivProfile, "profile");
// Apply the transaction
ft.commit();
}
else {
// Code to run on older devices
}
OUTPUT
参见**具有共享元件开始一个活动**在https://developer.android.com/training/material/animations.html部 – Virat18