繁体   English   中英

Android Instant App,为什么使用活动转换动画XML在功能模块中不起作用?

[英]Android Instant App, Why It doesn't work in feature module using activity transform animation XML?

您可以尝试此示例,以解决更改活动中的无效动画: https : //github.com/SwayChen/InstantAppTest

我在onCreate()onBackPressed()上都标记了一个TODO [应用程序模块工作正常,功能-不是]

以下是一些简短说明。

overridePendingTransition在app / library模块中overridePendingTransition正常工作。

但是现在它不能在功能模块中工作,启动Activity时只能有闪烁的动画。

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
    super.onCreate(savedInstanceState);
    overridePendingTransition(R.anim.slide_in_right, R.anim.none);
}

以下是两个动画XML:

R.anim.none:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
    android:duration="400"
    android:fromXDelta="0%"
    android:toXDelta="0%" />
</set>

R.anim.slide_in_right:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
    android:duration="320"
    android:fromXDelta="-100%"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:toXDelta="0%" />
</set>

好消息! 工程师已解决此问题, overridePendingTransition动画现在可以在O +设备上的Instant Apps中使用

pre-O设备上的AIA不支持自定义过渡动画,并且目前没有计划在不久的将来对此提供支持。

如果遇到任何问题,请报告友邦保险团队

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM