-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a splash screen when Amaze loads #3445
Add a splash screen when Amaze loads #3445
Conversation
flash screen added
flash screen added space removed
@EmmanuelMess : hello , spotless check is giving me error - |
Hey @EmmanuelMess may you please review this . |
@dhruvpatidar359 Press Ctrl twice & on that run anything prompt paste Push the changes this creates to the same branch. |
@VishnuSanal thanks for the help 😀. |
Hello @EmmanuelMess may you please review this. |
@dhruvpatidar359 I'll look into your PR by the weekend :) |
app/src/main/java/com/amaze/filemanager/ui/activities/FlashScreen.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/amaze/filemanager/ui/activities/FlashScreen.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/amaze/filemanager/ui/activities/FlashScreen.java
Outdated
Show resolved
Hide resolved
Timer().schedule( | ||
object : TimerTask() { | ||
override fun run() { | ||
startActivity(Intent(this@FlashScreen, MainActivity::class.java)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The activity should be started before the timer starts, so that it is available as fast as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually i am not able to figure out how can i do that , can you give me a hint for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can just do startActivity()
before the timer task, then bring to the front the view with the splash icon. That's how I did it for a game some time ago:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have tried it and it doesn't work (anymore?) you'll probably need to do another thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll probably have to reverse engineer the API 16 activity to check how it does it, and make it backwards compatible. Using onWindowFocusChanged(hasFocus: Boolean)
works for showing the splash but not for loading the new activity.
Remember a requirement is that the MainAcitivity starts loading immediately (within a few ms) after the splash activity starts.
text1.startAnimation(AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left)) | ||
|
||
activityScope.launch { | ||
delay(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to add a delay everytime app launches through launcher. However as per guidelines splash screen shouldn't be shown on hot starts
https://developer.android.com/develop/ui/views/launch/splash-screen
New Method Added for showing flashScreen
Signed-off-by: dhruv [email protected]
closes #3139
flash screen added
Description
Issue tracker
Automatic tests
Added test cases
Done
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug
./gradlew spotlessCheck