Skip to content

Commit

Permalink
🎨 Decreased padding and UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
shub39 committed Nov 11, 2024
1 parent cbc7ad9 commit 8b501fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -29,8 +32,8 @@ fun ArtFromUrl(
component = rememberImageComponent {
+ShimmerPlugin(
Shimmer.Resonate(
baseColor = MaterialTheme.colorScheme.surface,
highlightColor = MaterialTheme.colorScheme.primary
baseColor = baseColor,
highlightColor = highlightColor
)
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ fun LyricsPage(
AnimatedVisibility(top > 2) {
ArtFromUrl(
imageUrl = song.artUrl,
highlightColor = cardContent,
baseColor = cardBackground,
modifier = Modifier
.height(150.dp)
.fillMaxWidth(),
Expand Down Expand Up @@ -262,6 +264,8 @@ fun LyricsPage(
) {
ArtFromUrl(
imageUrl = song.artUrl,
highlightColor = cardContent,
baseColor = cardBackground,
modifier = Modifier
.clip(MaterialTheme.shapes.small)
.size(150.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ fun RushedShareCard(

Column(
modifier = Modifier
.padding(46.dp)
.fillMaxWidth()
.padding(28.dp)
.align(Alignment.Center)
) {
LazyColumn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -134,7 +137,7 @@ fun SpotifyShareCard(
Column (
modifier = Modifier
.fillMaxSize()
.padding(46.dp),
.padding(32.dp),
verticalArrangement = Arrangement.Center
) {
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8b501fe

Please sign in to comment.