是否有可用于在两个视图之间切换的所有动画列表?即缩放,幻灯片,脸等Android视图过渡动画列表?
我似乎无法找到一个全面的列表,无论是在SDK或通过搜索谷歌。
此外,是否有任何演示应用程序会显示所有这些应用程序,以便我可以评估哪些应用程序最适合特定用例?
是否有可用于在两个视图之间切换的所有动画列表?即缩放,幻灯片,脸等Android视图过渡动画列表?
我似乎无法找到一个全面的列表,无论是在SDK或通过搜索谷歌。
此外,是否有任何演示应用程序会显示所有这些应用程序,以便我可以评估哪些应用程序最适合特定用例?
无法创建动画的综合列表。你的想象力是可能动画数量的限制。
您可以使用可用的基本动画(alpha,scale,translate和rotate)的任意组合来在两个视图之间传输。 This可能会帮助你。
这里是你可以在XML文件中使用基本的动画的官方文档: https://developer.android.com/guide/topics/resources/animation-resource.html
有许多选项,使视图之间的动画有一些是基本的一个像阿尔法,缩放,平移和旋转也有新的材料设计理念,这引入了视图过渡
在这里你可以找到示例代码视图动画的材质设计的git参考 https://github.com/lgvalle/Material-Animations
您还可以应用超视距使用动画资源
这里呃动画活动代码你必须写
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscreen);
new Handler().postDelayed(new Runnable() {
public void run() {
/* Create an intent that will start the main activity. */
Intent mainIntent = new Intent(SplashScreen.this,
ConnectedActivity.class);
mainIntent.putExtra("id", "1");
//SplashScreen.this.startActivity(mainIntent);
startActivity(mainIntent);
/* Finish splash activity so user cant go back to it. */
SplashScreen.this.finish();
/* Apply our splash exit (fade out) and main
entry (fade in) animation transitions. */
overridePendingTransition(R.anim.mainfadein,R.anim.splashfadeout);
}
}, SPLASH_DISPLAY_TIME);
}
添加这两种文件在res /动画文件夹。
slide_in.xml
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_longAnimTime"
android:fromXDelta="100%p"
android:toXDelta="0%p">
</translate>
slide_out.xml
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_longAnimTime"
android:fromXDelta="0%p"
android:toXDelta="-100%p">
</translate>
我希望这将是解决你的疑问