Skip to content

Commit

Permalink
feat(installer): adjust arrow icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Oct 5, 2023
1 parent 6437f7b commit 39caad1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ import androidx.compose.ui.res.stringResource
import app.revanced.manager.R

@Composable
fun ArrowButton(expanded: Boolean, onClick: () -> Unit) {
fun ArrowButton(modifier: Modifier = Modifier, expanded: Boolean,onClick: () -> Unit) {
IconButton(onClick = onClick) {
val description = if (expanded) R.string.collapse_content else R.string.expand_content
val rotation by animateFloatAsState(targetValue = if (expanded) 0f else 180f)
val rotation by animateFloatAsState(targetValue = if (expanded) 0f else 180f, label = "rotation")

Icon(
imageVector = Icons.Filled.KeyboardArrowUp,
contentDescription = stringResource(description),
modifier = Modifier.rotate(rotation)
modifier = Modifier
.rotate(rotation)
.then(modifier)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fun InstallStep(step: Step) {

Spacer(modifier = Modifier.weight(1f))

ArrowButton(expanded = expanded) {
ArrowButton(modifier = Modifier.size(24.dp), expanded = expanded) {
expanded = !expanded
}
}
Expand Down Expand Up @@ -239,7 +239,10 @@ fun InstallStep(step: Step) {
)

if (stacktrace != null) {
ArrowButton(expanded = messageExpanded) {
ArrowButton(
modifier = Modifier.size(24.dp),
expanded = messageExpanded
) {
messageExpanded = !messageExpanded
}
} else {
Expand Down

0 comments on commit 39caad1

Please sign in to comment.