Skip to content

Conversation

@timusus
Copy link
Owner

@timusus timusus commented Feb 15, 2025

Note: This is done on the back of some really great work by @rivaldi8

Supersedes #159

@timusus timusus force-pushed the tech/compose-genre-migration branch from cd1128e to df82ce2 Compare February 15, 2025 10:49
Note: This is done on the back of some really great work by rivaldi8
@timusus timusus force-pushed the tech/compose-genre-migration branch from df82ce2 to 2b7b621 Compare February 15, 2025 10:52
@timusus timusus merged commit ef3e516 into main Feb 15, 2025
4 checks passed
@timusus timusus deleted the tech/compose-genre-migration branch February 15, 2025 23:40
genreRepository.getGenres(GenreQuery.All()),
mediaImportObserver.songImportState,
mediaImportObserver.playlistImportState
) { genres, songImportState, playlistImportState ->
Copy link
Contributor

Choose a reason for hiding this comment

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

We are combining here MediaImportObserver.playlistImportState but it isn't used. Does it make any difference to have it in the combine or could it be removed?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I think the logic below is incorrect, and we should show loading if the song import state or playlist import state is 'ImportProgress'

Copy link
Contributor

Choose a reason for hiding this comment

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

The import of songs affects because we don't want to show the list until all the genres (songs) have been loaded. But why should we care about the loading status of playlists while loading genres? The list won't change, right?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Great point!

contentPadding = PaddingValues(vertical = 16.dp, horizontal = 8.dp),
state = state
) {
items(genres + genres + genres + genres) { genre ->
Copy link
Contributor

Choose a reason for hiding this comment

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

These multiple genres look like a scrollbar test that you forgot to revert.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks, good pickup

modifier = Modifier.fillMaxSize().padding(vertical = 8.dp),
state = state,
getPopupText = { index ->
(genres + genres + genres + genres)[index].name.firstOrNull()?.toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

These multiple genres look like a scrollbar test that you forgot to revert.

LaunchedEffect(state.isScrollInProgress, isDragging) {
if (!state.isScrollInProgress && !isDragging) {
delay(1500)
if (!state.isScrollInProgress && !isDragging) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this second check redundant or is it needed because the state might've changed while on the delay?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes it might have changed, so we need to check the condition again

style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onBackground
)
// Todo: Manually replacing "{count}" is not ideal. But, the Phrase library doesn't render correctly in Compose.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't the solution be to change the {count} in strings_library.xml by %1$d? We can't do so now because it'd break other uses of songsPlural but we could do so in the future, right?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, that's right. I'm reluctant to change it because we'd have to revert the usage of the Phrase library which is all over the app at the moment

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.

3 participants