Status Update
Comments
al...@google.com <al...@google.com>
ca...@google.com <ca...@google.com> #2
The splash screen is dismissed as soon as the app is drawn and doesn't wait for the animation to finish which might be the reason why the animation doesn't repeat.
At most, the icon will animate for the value set in windowSplashScreenAnimationDuration
.
If that's not the case, can you please share your theme values and icon file? or at least a reproduction sample?
ap...@gtempaccount.com <ap...@gtempaccount.com> #3
windowSplashScreenBackground is #fff and #000 for dark theme.
The animation duration of Animated Vector Drawable is 1600.
I might not be able to share the icon since it is the one we are going to use in production. Is there any working Animated Vector Drawable you can provide from your side for us to compare? Anything from unit test?
ca...@google.com <ca...@google.com> #4
ca...@google.com <ca...@google.com> #5
In the <objectAnimator
tag, you need the repeat*
attributes
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:valueTo="200"
android:valueType="floatType"
android:propertyName="y"
android:repeatCount="1"
android:repeatMode="reverse"/>
ap...@gtempaccount.com <ap...@gtempaccount.com> #6
ap...@gtempaccount.com <ap...@gtempaccount.com> #7
ca...@google.com <ca...@google.com> #8
In that case, you'd need to manually make you application repeat using other ObjecAnimator. Since the splash screen is supposed to be short lived, an animation shouldn't need to be repeated.
If the loading time of your application is too high and require the use of some progress indicator, then I suggest to implement that in the app directly, ideally using skeletons loaders (
ca...@google.com <ca...@google.com> #9
ap...@gtempaccount.com <ap...@gtempaccount.com> #10
That's definitely something worth discussing internally, I've added it to the list of thing to consider for the next version. Thanks for your feedback.
ap...@gtempaccount.com <ap...@gtempaccount.com> #11
2022-01-24 18:35:19.874 9946-9946/com.xx.yy E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xx.yy, PID: 9946
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xx.yy/com.xx.yy.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:852)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:815)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:703)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.xx.yy.MainActivity.onCreate(MainActivity.kt:42)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at java.lang.reflect.Method.invoke(Native Method)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
using the current 1.0.0-beta01
style is still the one posted above, the postSplashScreenTheme is a descendant of Theme.AppCompat.Light.NoActionBar
ca...@google.com <ca...@google.com> #12
Did you call installSplashScreen()
before super.onCreate()?
Can you share your manifest and themes files?
ap...@gtempaccount.com <ap...@gtempaccount.com> #14
EDITED: sorry for the false negative before, i sometimes have issues with android studio not rebuilding correctly (mixing up ressources, cache etc.)
windowSplashScreenAnimatedIcon
isnt the app icon (from manifest) the default?
ca...@google.com <ca...@google.com> #15
Thanks for checking.
windowSplashScreenAnimatedIcon
isnt the app icon (from manifest) the default?
Unfortunately no, because there is no way to read the manifest from the theme file or tell the system to do so, and there is no default theme attribute pointing to the launcher icon.
To help me debug, can you please check if the issue arises when the android:theme="@style/SplashTheme"
is used on the <application>
tag?
ap...@gtempaccount.com <ap...@gtempaccount.com> #16
EDIT: mipmap seems so work, but the scale is off, is there an autofit setting?
ca...@google.com <ca...@google.com> #17
No there is not autofit setting, your icon should follow the adaptive icon
Description
*
Steps to reproduce
- Traget/compileSDK 31
- Add dependency
- Create splash screen theme in styles.xml
- Add style to main/launch activity
- Add installSplashScreen() to said activity
- Run on Android 9 device/emulator