Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fixme: disabled lazy column scroll bar due to app crash
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed May 3, 2024
1 parent 12e1a6e commit 5eed9c7
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import app.suhasdissa.vibeyou.domain.models.primary.Song
import app.suhasdissa.vibeyou.presentation.screens.localmusic.components.SortOrder
import app.suhasdissa.vibeyou.presentation.screens.player.model.PlayerViewModel
import app.suhasdissa.vibeyou.utils.TimeUtil
import my.nanihadesuka.compose.LazyColumnScrollbar

@OptIn(ExperimentalFoundationApi::class)
@Composable
Expand Down Expand Up @@ -61,53 +60,53 @@ fun SongListView(
}
}
val state = rememberLazyListState()
LazyColumnScrollbar(
listState = state,
thumbColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.5f),
thumbSelectedColor = MaterialTheme.colorScheme.primary,
thickness = 8.dp
// LazyColumnScrollbar(
// listState = state,
// thumbColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.5f),
// thumbSelectedColor = MaterialTheme.colorScheme.primary,
// thickness = 8.dp
// ) {
LazyColumn(
Modifier.fillMaxSize(),
state = state,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp)
) {
LazyColumn(
Modifier.fillMaxSize(),
state = state,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp)
) {
groups.forEach { group ->
stickyHeader {
Row(
Modifier
groups.forEach { group ->
stickyHeader {
Row(
Modifier
.fillMaxWidth()
.background(MaterialTheme.colorScheme.background)
) {
Text(
text = group.key,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSecondaryContainer,
modifier = Modifier
.fillMaxWidth()
.background(MaterialTheme.colorScheme.background)
) {
Text(
text = group.key,
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.onSecondaryContainer,
modifier = Modifier
.fillMaxWidth()
.clip(RoundedCornerShape(50))
.background(MaterialTheme.colorScheme.secondaryContainer)
.padding(vertical = 8.dp, horizontal = 16.dp)
)
}
}
items(items = group.value) { item ->
SongCard(
song = item,
onClickCard = {
playerViewModel.playSong(item)
},
onLongPress = {
selectedSong = item
showSongSettings = true
}
.clip(RoundedCornerShape(50))
.background(MaterialTheme.colorScheme.secondaryContainer)
.padding(vertical = 8.dp, horizontal = 16.dp)
)
}
}
items(items = group.value) { item ->
SongCard(
song = item,
onClickCard = {
playerViewModel.playSong(item)
},
onLongPress = {
selectedSong = item
showSongSettings = true
}
)
}
}
}
//}
}
if (showSongSettings) {
selectedSong?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import app.suhasdissa.vibeyou.R
import app.suhasdissa.vibeyou.domain.models.primary.Artist
import app.suhasdissa.vibeyou.presentation.components.IllustratedMessageScreen
import my.nanihadesuka.compose.LazyColumnScrollbar

@Composable
fun ArtistList(
Expand All @@ -25,25 +23,25 @@ fun ArtistList(
IllustratedMessageScreen(image = R.drawable.ic_launcher_monochrome)
}
val state = rememberLazyListState()
LazyColumnScrollbar(
listState = state,
thumbColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.5f),
thumbSelectedColor = MaterialTheme.colorScheme.primary,
thickness = 8.dp
// LazyColumnScrollbar(
// listState = state,
// thumbColor = MaterialTheme.colorScheme.primary.copy(alpha = 0.5f),
// thumbSelectedColor = MaterialTheme.colorScheme.primary,
// thickness = 8.dp
// ) {
LazyColumn(
modifier = Modifier.fillMaxSize(),
state = state,
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp)
) {
LazyColumn(
modifier = Modifier.fillMaxSize(),
state = state,
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp)
) {
items(items = items) { item ->
ArtistCard(
artist = item,
onClickCard = { onClickCard(item) },
onLongPress = { onLongPress(item) }
)
}
items(items = items) { item ->
ArtistCard(
artist = item,
onClickCard = { onClickCard(item) },
onLongPress = { onLongPress(item) }
)
}
}
// }
}

0 comments on commit 5eed9c7

Please sign in to comment.