Skip to content

Commit

Permalink
fix: snack bar & pull refresh color mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
urFate committed Sep 21, 2024
1 parent de33030 commit dfa30f0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,9 @@ fun Resource(
) {
PullRefreshIndicator(
refreshing = isRefreshing,
state = pullRefreshState
state = pullRefreshState,
contentColor = MaterialTheme.colorScheme.primary,
backgroundColor = MaterialTheme.colorScheme.surfaceContainer
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ fun SpecialSnackBar(
verticalAlignment = Alignment.CenterVertically
) {
icon()
Text(text = message, overflow = TextOverflow.Ellipsis)
Text(
text = message,
color = contentColor,
overflow = TextOverflow.Ellipsis
)
}

if(closeable) {
Expand All @@ -58,7 +62,7 @@ fun SpecialSnackBar(
contentAlignment = Alignment.CenterEnd
) {
IconButton(onClick = onCloseClick) {
Icon(imageVector = Icons.Rounded.Close, contentDescription = "Close")
Icon(imageVector = Icons.Rounded.Close, tint = contentColor, contentDescription = "Close")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ fun AppUpdateSnackbarHost(){
) { snackbarData: SnackbarData ->
SpecialSnackBar(
icon = {
Icon(
imageVector = Icons.Rounded.RocketLaunch,
contentDescription = "rocket launch"
)
},
Icon(
imageVector = Icons.Rounded.RocketLaunch,
tint = MaterialTheme.colorScheme.onPrimary,
contentDescription = "rocket launch"
)
},
message = snackbarData.visuals.message,
containerColor = MaterialTheme.colorScheme.primary,
contentColor = MaterialTheme.colorScheme.onPrimary,
onClick = {
snackbarData.performAction()
context.startActivity(Intent(context, AppUpdateActivity::class.java))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ fun ExploreScreen(
refreshing = model.refreshing.collectAsStateWithLifecycle().value,
state = pullRefreshState,
scale = true,
contentColor = MaterialTheme.colorScheme.primary
contentColor = MaterialTheme.colorScheme.primary,
backgroundColor = MaterialTheme.colorScheme.surfaceContainer
)
}
}
Expand Down

0 comments on commit dfa30f0

Please sign in to comment.