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

Commit

Permalink
style: fix placeholder illustration
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Jan 8, 2024
1 parent 473cc3a commit f6de1fb
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ fun IllustratedMessageScreen(
modifier = Modifier.size(350.dp),
painter = painterResource(id = R.drawable.blob),
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.errorContainer)
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.secondaryContainer)
)
Image(
modifier = Modifier.size(250.dp),
painter = painterResource(id = image),
contentDescription = null,
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onErrorContainer)
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onSecondaryContainer)
)
}
action()
Expand All @@ -72,7 +72,7 @@ fun IllustratedMessageScreen(
@Preview(showBackground = true)
private fun IllustratedMsgScreenPreview() {
IllustratedMessageScreen(
image = R.drawable.sad_mellow,
image = R.drawable.ic_launcher_monochrome,
message = R.string.something_went_wrong
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,16 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel
import app.suhasdissa.vibeyou.Destination
import app.suhasdissa.vibeyou.R
import app.suhasdissa.vibeyou.backend.viewmodel.PlaylistViewModel
import app.suhasdissa.vibeyou.ui.screens.playlists.PlaylistsScreen
import app.suhasdissa.vibeyou.ui.screens.songs.SongsScreen
import kotlinx.coroutines.launch

@OptIn(ExperimentalFoundationApi::class)
@Composable
fun MusicScreen(
onNavigate: (Destination) -> Unit,
playlistViewModel: PlaylistViewModel = viewModel(factory = PlaylistViewModel.Factory)
onNavigate: (Destination) -> Unit
) {
val pagerState = rememberPagerState { 3 }
val scope = rememberCoroutineScope()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fun AlbumScreen(
MiniPlayerScaffold {
when (state) {
AlbumInfoState.Error -> IllustratedMessageScreen(
image = R.drawable.sad_mellow,
image = R.drawable.ic_launcher_monochrome,
message = R.string.something_went_wrong
)

Expand All @@ -74,7 +74,10 @@ fun AlbumScreen(
) {
item {
Column(
Modifier.fillMaxWidth().padding(8.dp).padding(bottom = 8.dp),
Modifier
.fillMaxWidth()
.padding(8.dp)
.padding(bottom = 8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Expand All @@ -89,7 +92,11 @@ fun AlbumScreen(
contentScale = ContentScale.Crop,
error = painterResource(id = R.drawable.music_placeholder)
)
Column(Modifier.fillMaxWidth().padding(8.dp)) {
Column(
Modifier
.fillMaxWidth()
.padding(8.dp)
) {
Text(
text = state.album.title,
style = MaterialTheme.typography.titleLarge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun ArtistScreen(
}) {
when (state) {
ArtistInfoState.Error -> IllustratedMessageScreen(
image = R.drawable.sad_mellow,
image = R.drawable.ic_launcher_monochrome,
message = R.string.something_went_wrong
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ fun LocalSearchScreen(
localSearchViewModel.setSearchHistory()
}
val scroll = rememberScrollState()
Column(Modifier.verticalScroll(scroll).padding(horizontal = 8.dp)) {
Column(
Modifier
.verticalScroll(scroll)
.padding(horizontal = 8.dp)
) {
if (localSearchViewModel.songSearchSuggestion.isNotEmpty()) {
Text(
text = stringResource(R.string.songs),
Expand Down Expand Up @@ -180,7 +184,7 @@ fun LocalSearchScreen(

is SearchState.Error -> {
IllustratedMessageScreen(
image = R.drawable.sad_mellow,
image = R.drawable.ic_launcher_monochrome,
message = R.string.something_went_wrong
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ fun SearchScreen(
pipedSearchViewModel.setSearchHistory()
}
val scroll = rememberScrollState()
Column(Modifier.verticalScroll(scroll).padding(horizontal = 8.dp)) {
Column(
Modifier
.verticalScroll(scroll)
.padding(horizontal = 8.dp)
) {
if (pipedSearchViewModel.suggestions.isNotEmpty()) {
pipedSearchViewModel.suggestions.forEach {
ListItem(
Expand Down Expand Up @@ -201,7 +205,7 @@ fun SearchScreen(

is SearchState.Error -> {
IllustratedMessageScreen(
image = R.drawable.sad_mellow,
image = R.drawable.ic_launcher_monochrome,
message = R.string.something_went_wrong,
action = {
TextButton(
Expand Down
46 changes: 0 additions & 46 deletions app/src/main/res/drawable/sad_mellow.xml

This file was deleted.

0 comments on commit f6de1fb

Please sign in to comment.