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

Commit 6d59b10d authored by Sherry Zhou's avatar Sherry Zhou
Browse files

Fix clock showing 12 hour format when 24 hour format is chosen

Test: Manually
Bug: 271988126
Change-Id: Id3e71bfa79073558c15c921781ce5326c23b5a15
parent 6a039949
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ object ClockCarouselViewBinder {
                    }
                }

                launch {
                    viewModel.allClockIds.collect {
                        it.forEach { clockId -> clockViewFactory.updateTimeFormat(clockId) }
                    }
                }

                launch {
                    viewModel.selectedIndex.collect { selectedIndex ->
                        carouselView.setSelectedClockIndex(selectedIndex)
+6 −0
Original line number Diff line number Diff line
@@ -59,6 +59,12 @@ class ClockViewFactory(
            .onSeedColorChanged(seedColor)
    }

    fun updateTimeFormat(clockId: String) {
        getController(clockId)
            .events
            .onTimeFormatChanged(android.text.format.DateFormat.is24HourFormat(activity))
    }

    fun registerTimeTicker(owner: LifecycleOwner) {
        val hashCode = owner.hashCode()
        if (timeTickListeners.keys.contains(hashCode)) {