diff --git a/app/src/main/java/com/shub39/rush/ui/page/component/ArtFromUrl.kt b/app/src/main/java/com/shub39/rush/ui/page/component/ArtFromUrl.kt index 892cae2..260e10e 100644 --- a/app/src/main/java/com/shub39/rush/ui/page/component/ArtFromUrl.kt +++ b/app/src/main/java/com/shub39/rush/ui/page/component/ArtFromUrl.kt @@ -5,6 +5,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import coil.ImageLoader @@ -20,6 +21,8 @@ import org.koin.compose.koinInject fun ArtFromUrl( imageUrl: String?, modifier: Modifier = Modifier, + baseColor: Color = MaterialTheme.colorScheme.surface, + highlightColor: Color = MaterialTheme.colorScheme.primary, imageLoader: ImageLoader = koinInject() ) { CoilImage( @@ -29,8 +32,8 @@ fun ArtFromUrl( component = rememberImageComponent { +ShimmerPlugin( Shimmer.Resonate( - baseColor = MaterialTheme.colorScheme.surface, - highlightColor = MaterialTheme.colorScheme.primary + baseColor = baseColor, + highlightColor = highlightColor ) ) }, diff --git a/app/src/main/java/com/shub39/rush/ui/page/lyrics/LyricsPage.kt b/app/src/main/java/com/shub39/rush/ui/page/lyrics/LyricsPage.kt index 6cbabd2..8b33bb5 100644 --- a/app/src/main/java/com/shub39/rush/ui/page/lyrics/LyricsPage.kt +++ b/app/src/main/java/com/shub39/rush/ui/page/lyrics/LyricsPage.kt @@ -229,6 +229,8 @@ fun LyricsPage( AnimatedVisibility(top > 2) { ArtFromUrl( imageUrl = song.artUrl, + highlightColor = cardContent, + baseColor = cardBackground, modifier = Modifier .height(150.dp) .fillMaxWidth(), @@ -262,6 +264,8 @@ fun LyricsPage( ) { ArtFromUrl( imageUrl = song.artUrl, + highlightColor = cardContent, + baseColor = cardBackground, modifier = Modifier .clip(MaterialTheme.shapes.small) .size(150.dp) diff --git a/app/src/main/java/com/shub39/rush/ui/page/share/component/RushedShareCard.kt b/app/src/main/java/com/shub39/rush/ui/page/share/component/RushedShareCard.kt index 31cc508..85516ab 100644 --- a/app/src/main/java/com/shub39/rush/ui/page/share/component/RushedShareCard.kt +++ b/app/src/main/java/com/shub39/rush/ui/page/share/component/RushedShareCard.kt @@ -85,7 +85,8 @@ fun RushedShareCard( Column( modifier = Modifier - .padding(46.dp) + .fillMaxWidth() + .padding(28.dp) .align(Alignment.Center) ) { LazyColumn( diff --git a/app/src/main/java/com/shub39/rush/ui/page/share/component/SpotifyShareCard.kt b/app/src/main/java/com/shub39/rush/ui/page/share/component/SpotifyShareCard.kt index a8bae0d..9145a6f 100644 --- a/app/src/main/java/com/shub39/rush/ui/page/share/component/SpotifyShareCard.kt +++ b/app/src/main/java/com/shub39/rush/ui/page/share/component/SpotifyShareCard.kt @@ -7,6 +7,7 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn @@ -63,7 +64,9 @@ fun SpotifyShareCard( contentAlignment = Alignment.Center ) { Card( - modifier = Modifier.padding(32.dp), + modifier = Modifier + .fillMaxWidth() + .padding(28.dp), onClick = { variant = !variant }, colors = CardDefaults.cardColors( contentColor = innerContentColor, @@ -134,7 +137,7 @@ fun SpotifyShareCard( Column ( modifier = Modifier .fillMaxSize() - .padding(46.dp), + .padding(32.dp), verticalArrangement = Arrangement.Center ) { Row( diff --git a/app/src/main/java/com/shub39/rush/viewmodel/RushViewModel.kt b/app/src/main/java/com/shub39/rush/viewmodel/RushViewModel.kt index 45cf7fd..cdb00a8 100644 --- a/app/src/main/java/com/shub39/rush/viewmodel/RushViewModel.kt +++ b/app/src/main/java/com/shub39/rush/viewmodel/RushViewModel.kt @@ -316,7 +316,7 @@ class RushViewModel( query: String, fetch: Boolean = _lyricsState.value.autoChange, ) { - if (query.isEmpty() || _lyricsState.value.searching.first) return + if (query.isEmpty() || _lyricsState.value.searching.first || query == _lastSearched.value) return viewModelScope.launch { _lyricsState.update {