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

Showing the default preference setting in split second on time while start the app #13

Open
BitMavrick opened this issue Sep 14, 2023 · 2 comments · May be fixed by #15
Open

Showing the default preference setting in split second on time while start the app #13

BitMavrick opened this issue Sep 14, 2023 · 2 comments · May be fixed by #15

Comments

@BitMavrick
Copy link

BitMavrick commented Sep 14, 2023

In the ViewModel there's code ,

data class DessertReleaseUiState( val isLinearLayout: Boolean = true, val toggleContentDescription: Int = if (isLinearLayout) R.string.grid_layout_toggle else R.string.linear_layout_toggle, val toggleIcon: Int = if (isLinearLayout) R.drawable.ic_grid_layout else R.drawable.ic_linear_layout )

which shows the default settings, after in very short delay the preference setting restored. I think it would be nice to showing any splash screen or some loading animation in the meantime that moment of time

@Derrick-Mwendwa
Copy link

I've noticed this too. When you change the layout to grid and the preference is stored, when relaunching the app it will display the linear layout for a split second before switching to grid (it may not be visible in release configuration but I am not sure).

I am not sure of the exact cause of this but I think it occurs when we convert our cold flow to a hot one in the viewmodel, it could have something to do with the initialValue parameter.

@Jaehwa-Noh
Copy link

I also noticed it. It is because of DataStore feature, which supports fully asynchronous work, not synchronous.

@Jaehwa-Noh Jaehwa-Noh linked a pull request Feb 3, 2024 that will close this issue
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 a pull request may close this issue.

3 participants