Skip to content

Commit ae0cdb9

Browse files
committed
chore: use arrow icon instead of text arrow in accent color preference
1 parent dfb9354 commit ae0cdb9

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/com/bnyro/translate/ui/components/prefs/AccentColorPref.kt

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import android.os.Build
2121
import androidx.compose.animation.core.LinearEasing
2222
import androidx.compose.animation.core.animateFloatAsState
2323
import androidx.compose.animation.core.tween
24+
import androidx.compose.foundation.Image
2425
import androidx.compose.foundation.background
2526
import androidx.compose.foundation.clickable
2627
import androidx.compose.foundation.layout.Box
@@ -29,9 +30,15 @@ import androidx.compose.foundation.layout.Row
2930
import androidx.compose.foundation.layout.Spacer
3031
import androidx.compose.foundation.layout.fillMaxWidth
3132
import androidx.compose.foundation.layout.height
33+
import androidx.compose.foundation.layout.padding
3234
import androidx.compose.foundation.layout.size
3335
import androidx.compose.foundation.shape.CircleShape
36+
import androidx.compose.material.icons.Icons
37+
import androidx.compose.material.icons.automirrored.filled.ArrowForward
38+
import androidx.compose.material.icons.automirrored.filled.ArrowRight
39+
import androidx.compose.material.icons.filled.ArrowForward
3440
import androidx.compose.material3.AlertDialog
41+
import androidx.compose.material3.Icon
3542
import androidx.compose.material3.MaterialTheme
3643
import androidx.compose.material3.Switch
3744
import androidx.compose.material3.Text
@@ -125,22 +132,25 @@ fun AccentColorPrefDialog(
125132

126133
Column(
127134
horizontalAlignment = Alignment.CenterHorizontally,
128-
modifier = Modifier.height(250.dp).alpha(imageAlpha).let {
129-
if (isColorPickerEnabled) {
130-
it
131-
} else {
132-
// disable input
133-
it.pointerInput(Unit){
134-
awaitPointerEventScope {
135-
while (true) {
136-
awaitPointerEvent(pass = PointerEventPass.Initial)
137-
.changes
138-
.forEach(PointerInputChange::consume)
135+
modifier = Modifier
136+
.height(250.dp)
137+
.alpha(imageAlpha)
138+
.let {
139+
if (isColorPickerEnabled) {
140+
it
141+
} else {
142+
// disable input
143+
it.pointerInput(Unit) {
144+
awaitPointerEventScope {
145+
while (true) {
146+
awaitPointerEvent(pass = PointerEventPass.Initial)
147+
.changes
148+
.forEach(PointerInputChange::consume)
149+
}
139150
}
140151
}
141152
}
142153
}
143-
}
144154
) {
145155
listOf("R", "G", "B").forEachIndexed { index, c ->
146156
val startIndex = index * 2
@@ -169,7 +179,12 @@ fun AccentColorPrefDialog(
169179
CircleShape
170180
)
171181
)
172-
Text(text = " => ", fontSize = 27.sp)
182+
Icon(
183+
modifier = Modifier.padding(horizontal = 10.dp),
184+
imageVector = Icons.AutoMirrored.Default.ArrowForward,
185+
tint = MaterialTheme.colorScheme.onBackground,
186+
contentDescription = null
187+
)
173188
Box(
174189
modifier = Modifier
175190
.size(50.dp)

0 commit comments

Comments
 (0)