Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the code #1170

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ fun Discover(
targetState = selectedCategory,
modifier = Modifier
.fillMaxWidth()
.weight(1f)
.weight(1f),
label = "crossfade_discover",
) { category ->
/**
* TODO, need to think about how this will scroll within the outer VerticalScroller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import com.example.jetcaster.data.Category
import com.example.jetcaster.data.CategoryStore
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,27 @@ fun ToggleFollowPodcastIconButton(
when {
isFollowed -> LocalContentColor.current
else -> Color.Black.copy(alpha = ContentAlpha.high)
}
},
label = "animation_tint_color_toggle_follow_icon_button"
).value,
modifier = Modifier
.shadow(
elevation = animateDpAsState(if (isFollowed) 0.dp else 1.dp).value,
elevation = animateDpAsState(
if (isFollowed)
0.dp
else
1.dp,
label = "animation_elevation_dp_toggle_follow_icon_button"
).value,
shape = MaterialTheme.shapes.small
)
.background(
color = animateColorAsState(
when {
isFollowed -> MaterialTheme.colors.surface.copy(0.38f)
else -> Color.White
}
},
label = "animation_background_color_toggle_follow_icon_button",
).value,
shape = MaterialTheme.shapes.small
)
Expand Down