Skip to content

Commit

Permalink
chore: use arrow icon instead of text arrow in accent color preference
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Dec 8, 2024
1 parent dfb9354 commit ae0cdb9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import android.os.Build
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
Expand All @@ -29,9 +30,15 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowForward
import androidx.compose.material.icons.automirrored.filled.ArrowRight
import androidx.compose.material.icons.filled.ArrowForward
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Switch
import androidx.compose.material3.Text
Expand Down Expand Up @@ -125,22 +132,25 @@ fun AccentColorPrefDialog(

Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.height(250.dp).alpha(imageAlpha).let {
if (isColorPickerEnabled) {
it
} else {
// disable input
it.pointerInput(Unit){
awaitPointerEventScope {
while (true) {
awaitPointerEvent(pass = PointerEventPass.Initial)
.changes
.forEach(PointerInputChange::consume)
modifier = Modifier
.height(250.dp)
.alpha(imageAlpha)
.let {
if (isColorPickerEnabled) {
it
} else {
// disable input
it.pointerInput(Unit) {
awaitPointerEventScope {
while (true) {
awaitPointerEvent(pass = PointerEventPass.Initial)
.changes
.forEach(PointerInputChange::consume)
}
}
}
}
}
}
) {
listOf("R", "G", "B").forEachIndexed { index, c ->
val startIndex = index * 2
Expand Down Expand Up @@ -169,7 +179,12 @@ fun AccentColorPrefDialog(
CircleShape
)
)
Text(text = " => ", fontSize = 27.sp)
Icon(
modifier = Modifier.padding(horizontal = 10.dp),
imageVector = Icons.AutoMirrored.Default.ArrowForward,
tint = MaterialTheme.colorScheme.onBackground,
contentDescription = null
)
Box(
modifier = Modifier
.size(50.dp)
Expand Down

0 comments on commit ae0cdb9

Please # to comment.