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?
ki...@smartpatient.eu <ki...@smartpatient.eu> #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
ki...@smartpatient.eu <ki...@smartpatient.eu> #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"/>
ca...@google.com <ca...@google.com> #6
ca...@google.com <ca...@google.com> #7
ki...@smartpatient.eu <ki...@smartpatient.eu> #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
ki...@smartpatient.eu <ki...@smartpatient.eu> #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.
ca...@google.com <ca...@google.com> #11
Thank you for your feedback
ca...@google.com <ca...@google.com> #12
After further investigation, I found a suitable fix. Hera is a demo with and without the fix
ki...@smartpatient.eu <ki...@smartpatient.eu> #13
Do you know when a fix will be available?
ca...@google.com <ca...@google.com> #14
I can't make any promises but I estimate within the 2 next weeks if no other bug arise.
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit 5a75362dc96ccaebf9a431c8facd899e1bb5ae34
Author: Vadim Caen <caen@google.com>
Date: Fri Oct 15 21:33:58 2021
Fix systemBar flickering on API 31
On API 31, if an OnExitAnimationListener is set, the Window layout params are only
applied only when the [android.window.SplashScreenView] is removed. This lead to some
flickers.
To fix this, we apply these attributes to the window while the
[android.window.SplashScreenView] is still visible.
Bug: 196273921
Test: SplashscreenParametrizedTest#endStateStableWithAndWithoutListener
Change-Id: I7e0593caba49563ccf06892df7f294e43ead7a5d
M core/core-splashscreen/src/androidTest/AndroidManifest.xml
M core/core-splashscreen/samples/src/main/res/layout/main_activity.xml
M core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreen.kt
M core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashscreenParametrizedTest.kt
M core/core-splashscreen/src/androidTest/res/layout/main_activity.xml
A core/core-splashscreen/src/main/java/androidx/core/splashscreen/ThemeUtils.kt
M core/core-splashscreen/src/androidTest/res/values/styles.xml
M core/core-splashscreen/src/androidTest/java/androidx/core/splashscreen/test/SplashScreenTestActivities.kt
A core/core-splashscreen/samples/src/main/res/drawable/vertical_line.xml
M core/core-splashscreen/src/main/java/androidx/core/splashscreen/SplashScreenViewProvider.kt
ca...@google.com <ca...@google.com>
sh...@gmail.com <sh...@gmail.com> #16
I don't think this issue has been fixed entirely. Yes it seems the style is applied, but it breaks the automatic colour change of the navigation bar and doesn't apply the scrim behind 3 button navigation.
Follow these steps to reproduce.
- Create a new project (I used a bottom tab project for my base)
- Implement basic instructions for SplashScreen (have some code snippits below)
- Implement edge-to-edge as in this document
https://developer.android.com/develop/ui/views/layout/edge-to-edge#java If your activity has a dark background, you'd think to setandroid:windowLightNavigationBar
to false, but setting this attribute will stop the automatic contrast feature for the bottom buttons.
Important to note, this is NOT an issue when using the gesture based navigation. Seems to only impact 2 & 3 button navigation.
Here is some code to kickstart.
themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyApplication" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
<item name="android:navigationBarColor">
@android:color/transparent
</item>
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="Theme.App.Starting" parent="Theme.SplashScreen">
<item name="windowSplashScreenBackground">@color/splashscreen_bg</item>
<item name="postSplashScreenTheme">@style/Theme.MyApplication</item>
</style>
</resources>
MainActivity
SplashScreen splashScreen = SplashScreen.installSplashScreen(this);
super.onCreate(savedInstanceState);
WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
splashScreen.setOnExitAnimationListener(splashScreenViewProvider -> {
final View splashScreenView = splashScreenViewProvider.getView();
splashScreenView
.animate()
.setDuration(0)
// Hack to avoid automatic layout transitions
.setStartDelay(Math.min(0, 0))
.alpha(0.0f)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
splashScreenViewProvider.remove();
}
}).start();
});
ad...@gmail.com <ad...@gmail.com> #17
I personally like to stay up to date but setKeepOnScreenCondition was introduced from 1.0.0-beta01, so I'm stuck with this bug.
ya...@gmail.com <ya...@gmail.com> #18
Can confirm. It only works in version 1.0.0-alpha02. All other version after are broken when using exit animation.
ht...@mega.co.nz <ht...@mega.co.nz> #19
to...@gmail.com <to...@gmail.com> #20
Yes. I reported it as
We can use `androidx.core:core-splashscreen:1.2.0-alpha01`
Description
Component used: core-splashscreen Version used: 1.0.0-alpha01 Devices/Android versions reproduced on: API 31
When
setOnExitAnimationListener
is used then wrong colors appear on NavigationBar and StatusBar.