Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e49a5b4e authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[flexiglass] The active dot in the unlock pattern has a separate color.

Fix: 438750553
Test: Manually tested by opening the pattern bouncer, drawing a pattern
 and observing the dots. Tested with "Make pattern visible" setting
 turn on and off.
Flag: com.android.systemui.scene_container
Change-Id: Ibb0d065ef0da97daa3947eda062fd5ff71065352
parent 75518118
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.LayoutCoordinates
@@ -93,7 +94,8 @@ fun PatternBouncer(
    val colCount = viewModel.columnCount
    val rowCount = viewModel.rowCount

    val dotColor = MaterialTheme.colorScheme.onSurface
    val idleDotColor = MaterialTheme.colorScheme.onSurface
    val activeDotColor = MaterialTheme.colorScheme.onPrimary
    val dotRadius = with(density) { (DOT_DIAMETER_DP / 2).dp.toPx() }
    val lineColor = MaterialTheme.colorScheme.primary
    val lineStrokeWidth = with(density) { LINE_STROKE_WIDTH_DP.dp.toPx() }
@@ -382,9 +384,11 @@ fun PatternBouncer(
                                verticalOffset + appearOffset,
                            ),
                        color =
                            dotColor.copy(
                                alpha = checkNotNull(dotAppearFadeInAnimatables[dot]).value
                            ),
                            if (isAnimationEnabled && dot == currentDot) {
                                activeDotColor
                            } else {
                                idleDotColor
                            }.copy(alpha = checkNotNull(dotAppearFadeInAnimatables[dot]).value),
                        radius = dotRadius * checkNotNull(dotScalingAnimatables[dot]).value,
                    )
                }