Skip to content
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

Feat: Implemented splash screen #84

Merged
merged 6 commits into from
Nov 6, 2023
Merged

Conversation

rasvanjaya21
Copy link
Contributor

this PR is under the tagline simple things are the best most of times ~ quotes by @lorenzovngl

@rasvanjaya21
Copy link
Contributor Author

preview

splashscreen-fed-preview.mp4

Copy link
Owner

@lorenzovngl lorenzovngl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good solution! A few refinements and it will be ok.

Comment on lines 4 to 5
android:height="118dp"
android:width="118dp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to set it to 100dp x 100dp. I found that on Pixel 3a API 33 the current sizes (118dp) cause a crop.
The guidelines suggests to use a vector icon, but a this time I don't have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for late response,
I got them, I'm forgot to test the responsive for any screen, thanks for suggestion

Comment on lines 29 to 32
_isSplashScreenLoading.value = true
expirationDates = repository.getAll()
delay(2000)
_isSplashScreenLoading.value = false
Copy link
Owner

@lorenzovngl lorenzovngl Oct 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. This codes added an additional delay to the call repository.getAll(), so I think it's better to use the delay to execute the call to the database. I propose this code:

_isSplashScreenLoading.value = true
val deferred = async {
    expirationDates = repository.getAll()
}
delay(1000)
deferred.await()
_isSplashScreenLoading.value = false

Here the call to the database is executed asynchronously, and the delay don't wait the db call to terminate. However, if the call to the db is longer that the delay, the await() tells the app to don't visualize the list of item unit the db call returned.
Also I think 1 second delay is enough.
Do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, I have updated the code as your great advice. strongly agreed.

tested device for splash screen area (asset not overlapped) :
redmi 9 A12 ✅ | emulator Pixel 5 A11 ✅ | other devices ❎

@lorenzovngl
Copy link
Owner

Great work! Thank you!

@lorenzovngl lorenzovngl merged commit 1746aac into lorenzovngl:main Nov 6, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants