Anki-Android icon indicating copy to clipboard operation
Anki-Android copied to clipboard

[Feature] Add Splash screen

Open S-H-Y-A opened this issue 1 year ago • 11 comments

Purpose / Description

Splash screen is one of new Android features and it makes user experiences richer.

This animation is Inspired by the navbar branding image of Anki Web

Fixes

  • Fixes #14838

Approach

create splash screen

~android 11 android 12
Screenshot_20231128_223536

How Has This Been Tested?

  • physical device (Android 13)
  • emulator on Android Studio (Android 7.1) P.S the difference of color of star is already fixed.

Checklist

Please, go through these checks before submitting the PR.

  • [x] You have a descriptive commit message with a short title (first line, max 50 chars).
  • [x] You have commented your code, particularly in hard-to-understand areas
  • [x] You have performed a self-review of your own code
  • [x] UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • [x] UI Changes: You have tested your change using the Google Accessibility Scanner

S-H-Y-A avatar Nov 29 '23 08:11 S-H-Y-A

Is this really needed that too using a dependency? we already have a splash screen ig

criticalAY avatar Nov 29 '23 09:11 criticalAY

Is this really needed that too using a dependency? we already have a splash screen ig

Ops, this fallback method for android11 and below seems not to depend on androidx.core.core-splashscreen. I'll remove the dependency within a few hours (because I'm not in home now.)

S-H-Y-A avatar Nov 29 '23 10:11 S-H-Y-A

I can't determine what is wrong because the lint error happens in the code whch has'nt been modified. I'll try to reset my git commits and recommit.

S-H-Y-A avatar Nov 30 '23 14:11 S-H-Y-A

Thanks for trying, I'll take a look

david-allison avatar Nov 30 '23 15:11 david-allison

From the video, the spinning animation seems much too fast, I'd see about reducing the speed to maybe 0.75x what's currently there.

Thank you for your advice. I changed the rotation speed, however, both my smartphone and pc are not high end models, and it was found I couldn't record the screen as usual. So, I would like to ask @david-allison to check the animation yourself.

S-H-Y-A avatar Nov 30 '23 15:11 S-H-Y-A

The following are unused:

  • Theme_Dark.Launcher.NoTitleBar
  • splash_icon_adaptive.xml

We need to improve our lint error reporting

david-allison avatar Nov 30 '23 15:11 david-allison

There's not enough time to show the 'star' before the splash screen disappears

Same here. In those cases, having no animation looks better IMHO

BrayanDSO avatar Dec 02 '23 00:12 BrayanDSO

On my phone/emulator, the opposite problem occurs:

There's not enough time to show the 'star' before the splash screen disappears

When I add a sleep, the star spins too quickly

Don't worry about the lint errors for now, I've added this to make them easier to diagnose, should be in main later:

I fixed these problems, however, I realized a hack* to rotate star infinitely didn't work well on Android13 and avobe, so I made the star rotate jsut once.

I thought It might be better not to rotate the star.


* This hack is to set
android:repeatMode="restart"
android:repeatCount="infinite"

to objectAnimator.

Splash screen is removed when windowSplashScreenAnimationDuration pass and the system is ready for drawing the view.

On Android 12 the hack works well because windowSplashScreenAnimationDuration is set in style.xml manually. On Android 13 and avobe, however, the system set windowSplashScreenAnimationDuration 0 automatically and start removing splash screen as soon as it's ready and then splash screen doesn't last until the animation finish. The reason why it happens is that the system on Android 11 and avobe tries to estimate the duration of the vector animation automatically, but it can't because of the hack.

Due to the bad performance of my smartphone, I couldn't realize that the hack doesn't work.

S-H-Y-A avatar Dec 03 '23 08:12 S-H-Y-A

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

github-actions[bot] avatar Dec 22 '23 02:12 github-actions[bot]

Would like to take over it

criticalAY avatar Jan 01 '24 11:01 criticalAY

Sounds good

david-allison avatar Jan 01 '24 16:01 david-allison