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

Commit 9fcf4577 authored by Catherine Liang's avatar Catherine Liang
Browse files

Hide clock accessibility action when there is 1 or no clock

When there are no clocks to choose from, hide accessibility action on
carousel view to avoid confusion.

Flag: EXEMPT bug fix
Bug: 378604758
Test: manually verified with 0 and 1 clock
Change-Id: I7c8818478477497ffdda60ed5993d4f801f02d9f
parent 6164e9d5
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ object ClockCarouselViewBinder {
                scrollBackwardCallback = {
                    // Callback code for scrolling backward
                    carouselView.transitionToPrevious()
                }
                },
            )
        lifecycleOwner.lifecycleScope.launch {
            lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
@@ -71,7 +71,13 @@ object ClockCarouselViewBinder {
                            },
                            isTwoPaneAndSmallWidth = isTwoPaneAndSmallWidth,
                        )
                        carouselView.accessibilityDelegate = carouselAccessibilityDelegate
                        // Only show accessibility action when there is >1 clock to choose from
                        carouselView.accessibilityDelegate =
                            if (allClocks.size > 1) {
                                carouselAccessibilityDelegate
                            } else {
                                null
                            }
                        screenPreviewClickView.setOnSideClickedListener { isStart ->
                            if (isStart) carouselView.scrollToPrevious()
                            else carouselView.scrollToNext()