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

Commit ebecdb5a authored by Catherine Liang's avatar Catherine Liang Committed by Android (Google) Code Review
Browse files

Merge "Hide clock click delegate view for A11y when not interactable (2/2)" into main

parents 9e3fa85c 16ebac2b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -111,6 +111,9 @@
    <!-- Description for clock font editor axis revert button. [CHAR LIMIT=NONE] -->
    <string name="clock_font_editor_revert">Undo clock font changes</string>

    <!-- Description for a clock style setting that toggles the clock font between one with rounded corners and one without. [CHAR LIMIT=NONE] -->
    <string name="clock_style_round_clock">Round clock</string>

    <!-- Toast message to notify that the clock style is updated when they tap on the clock face. They can tap again to undo. [CHAR LIMIT=NONE] -->
    <string name="clock_style_update_toast">Style changed to <xliff:g name="font_name">%1$s</xliff:g>. Tap again to undo.</string>

+13 −4
Original line number Diff line number Diff line
@@ -645,11 +645,20 @@ constructor(private val defaultCustomizationOptionsBinder: DefaultCustomizationO
                            ::Pair,
                        )
                        .collect { (selectedOption, onClockFaceClicked) ->
                            clockFaceClickDelegateView.isVisible =
                                selectedOption == ThemePickerLockCustomizationOption.CLOCK
                            if (
                                selectedOption == ThemePickerLockCustomizationOption.CLOCK &&
                                    onClockFaceClicked != null
                            ) {
                                clockFaceClickDelegateView.isVisible = true
                                clockFaceClickDelegateView.setOnClickListener {
                                    onClockFaceClicked.invoke()
                                }
                            } else {
                                clockFaceClickDelegateView.isVisible = false
                                clockFaceClickDelegateView.setOnClickListener(null)
                            }
                            clockFaceClickDelegateView.contentDescription =
                                context.getString(R.string.clock_style_round_clock)
                        }
                }

+3 −3
Original line number Diff line number Diff line
@@ -270,14 +270,14 @@ constructor(
    // and the clock style preset group index changes. The integer is the updated group index.
    val showClockFacePresetGroupIndexUpdateToast: Flow<Int> =
        _showClockFacePresetGroupIndexUpdateToast.asStateFlow().filterNotNull()
    val onClockFaceClicked: Flow<() -> Unit> =
    val onClockFaceClicked: Flow<(() -> Unit)?> =
        combine(groups, previewingClockPresetIndexedStyle) { groups, previewingIndexedStyle ->
            if (groups.isNullOrEmpty()) {
                {}
                null
            } else {
                val groupCount = groups.size
                if (groupCount == 1) {
                    {}
                    null
                } else {
                    val currentGroupIndex = previewingIndexedStyle?.groupIndex ?: 0
                    val nextGroupIndex = (currentGroupIndex + 1) % groupCount