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

Commit c326c026 authored by George Lin's avatar George Lin Committed by Automerger Merge Worker
Browse files

Merge "Adds new mappings to content descriptions for custom clock faces" into...

Merge "Adds new mappings to content descriptions for custom clock faces" into udc-dev am: bd10aa9c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/ThemePicker/+/23727699



Change-Id: I7de91becb46d01290fc2bfcadb5ac246c0cda893
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3c9ecb78 bd10aa9c
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -43,7 +43,8 @@
            android:layout_width="@dimen/screen_preview_width"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:clipChildren="false">
            android:clipChildren="false"
            android:importantForAccessibility="noHideDescendants">
            <com.android.customization.picker.clock.ui.view.ClockHostView
                android:id="@+id/clock_host_view_0"
                android:layout_width="match_parent"
@@ -74,7 +75,8 @@
            android:layout_width="@dimen/screen_preview_width"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:clipChildren="false">
            android:clipChildren="false"
            android:importantForAccessibility="noHideDescendants">
            <com.android.customization.picker.clock.ui.view.ClockHostView
                android:id="@+id/clock_host_view_1"
                android:layout_width="match_parent"
@@ -107,7 +109,8 @@
            android:layout_width="@dimen/screen_preview_width"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:clipChildren="false">
            android:clipChildren="false"
            android:importantForAccessibility="noHideDescendants">
            <com.android.customization.picker.clock.ui.view.ClockHostView
                android:id="@+id/clock_host_view_2"
                android:layout_width="match_parent"
@@ -138,7 +141,8 @@
            android:layout_width="@dimen/screen_preview_width"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:clipChildren="false">
            android:clipChildren="false"
            android:importantForAccessibility="noHideDescendants">
            <com.android.customization.picker.clock.ui.view.ClockHostView
                android:id="@+id/clock_host_view_3"
                android:layout_width="match_parent"
@@ -169,7 +173,8 @@
            android:layout_width="@dimen/screen_preview_width"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:clipChildren="false">
            android:clipChildren="false"
            android:importantForAccessibility="noHideDescendants">
            <com.android.customization.picker.clock.ui.view.ClockHostView
                android:id="@+id/clock_host_view_4"
                android:layout_width="match_parent"
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
    <!-- The content description of clock entry. [CHAR LIMIT=NONE] -->
    <string name="clock_picker_entry_content_description">Change a custom clock</string>

    <!-- action description for announcing selected Clock [CHAR LIMIT=NONE]-->
    <string name="select_clock_action_description">Clock face option <xliff:g name="clock_face_description">%1$s</xliff:g></string>

    <!-- Title of a section of the customization picker where the user can configure Clock face. [CHAR LIMIT=19] -->
    <string name="clock_settings_title">Clock color &amp; size</string>

+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import com.android.customization.picker.clock.ui.view.ClockViewFactory
import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel
import com.android.customization.picker.clock.ui.viewmodel.ClockSectionViewModel
import com.android.customization.picker.clock.ui.viewmodel.ClockSettingsViewModel
import com.android.customization.picker.clock.utils.ClockDescriptionUtils
import com.android.customization.picker.color.domain.interactor.ColorPickerInteractor
import com.android.customization.picker.color.ui.viewmodel.ColorPickerViewModel
import com.android.customization.picker.quickaffordance.domain.interactor.KeyguardQuickAffordancePickerInteractor
@@ -76,4 +77,6 @@ interface CustomizationInjector : Injector {
        wallpaperColorsViewModel: WallpaperColorsViewModel,
        clockViewFactory: ClockViewFactory,
    ): ClockSettingsViewModel.Factory

    fun getClockDescriptionUtils(): ClockDescriptionUtils
}
+8 −0
Original line number Diff line number Diff line
@@ -51,6 +51,8 @@ import com.android.customization.picker.clock.ui.view.ClockViewFactory
import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel
import com.android.customization.picker.clock.ui.viewmodel.ClockSectionViewModel
import com.android.customization.picker.clock.ui.viewmodel.ClockSettingsViewModel
import com.android.customization.picker.clock.utils.ClockDescriptionUtils
import com.android.customization.picker.clock.utils.ThemePickerClockDescriptionUtils
import com.android.customization.picker.color.data.repository.ColorPickerRepositoryImpl
import com.android.customization.picker.color.domain.interactor.ColorPickerInteractor
import com.android.customization.picker.color.domain.interactor.ColorPickerSnapshotRestorer
@@ -115,6 +117,7 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject
    private var themedIconSnapshotRestorer: ThemedIconSnapshotRestorer? = null
    private var themedIconInteractor: ThemedIconInteractor? = null
    private var clockSettingsViewModelFactory: ClockSettingsViewModel.Factory? = null
    private var clockDescriptionUtils: ClockDescriptionUtils? = null
    private var gridInteractor: GridInteractor? = null
    private var gridSnapshotRestorer: GridSnapshotRestorer? = null
    private var gridScreenViewModelFactory: GridScreenViewModel.Factory? = null
@@ -534,6 +537,11 @@ open class ThemePickerInjector : WallpaperPicker2Injector(), CustomizationInject
                .also { clockSettingsViewModelFactory = it }
    }

    override fun getClockDescriptionUtils(): ClockDescriptionUtils {
        return clockDescriptionUtils
            ?: ThemePickerClockDescriptionUtils().also { clockDescriptionUtils = it }
    }

    fun getGridScreenViewModelFactory(
        context: Context,
    ): ViewModelProvider.Factory {
+8 −6
Original line number Diff line number Diff line
@@ -50,20 +50,22 @@ object ClockCarouselViewBinder {
                launch { viewModel.isCarouselVisible.collect { carouselView.isVisible = it } }

                launch {
                    combine(viewModel.selectedClockSize, viewModel.allClockIds, ::Pair).collect {
                        (size, allClockIds) ->
                    combine(viewModel.selectedClockSize, viewModel.allClocks, ::Pair).collect {
                        (size, allClocks) ->
                        carouselView.setUpClockCarouselView(
                            clockSize = size,
                            clockIds = allClockIds,
                            onClockSelected = { clockId -> viewModel.setSelectedClock(clockId) },
                            clocks = allClocks,
                            onClockSelected = { clock ->
                                viewModel.setSelectedClock(clock.clockId)
                            },
                            isTwoPaneAndSmallWidth = isTwoPaneAndSmallWidth,
                        )
                    }
                }

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

Loading