george-martinec commented on issue #1514: URL: https://github.com/apache/cordova-android/issues/1514#issuecomment-1407834247
Looks like Android bug to me, After a month of searching I still coudn't find answer. Another example of blinking h(https://user-images.githubusercontent.com/87377447/199131487-c5db6ba5-22e1-41ec-9791-05c3ccacdf7b.mp4) It has something to do with setting image to alpha 1f before animating it to alpha 0, if you see code where splashImage has something like this: ``` splashImage.setAlpha(1f); ``` Following by ``` splashImage .animate() .alpha(0) .setInterpolator(new LinearInterpolator()) .setDuration(fadeOutDuration) .setListener(listener) .start(); ``` You need to calculate the remaining alpha, you can't just set 1, similar to this code for calculating **remaining duration** (_this code example is not for calculating remaining alpha)_: ``` // Get the duration of the animated vector drawable. Duration animationDuration = splashScreenView.getIconAnimationDuration(); // Get the start time of the animation. Instant animationStart = splashScreenView.getIconAnimationStart(); // Calculate the remaining duration of the animation. long remainingDuration; if (animationDuration != null && animationStart != null) { remainingDuration = animationDuration.minus( Duration.between(animationStart, Instant.now()) ).toMillis(); remainingDuration = Math.max(remainingDuration, 0L); } else { remainingDuration = 0L; } ``` https://developer.android.com/develop/ui/views/launch/splash-screen **This bug is for Android 12.0+** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
