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

Commit e694242e authored by George Lin's avatar George Lin
Browse files

[TP] Remove clock carousel on clock settings screen

Test: Manually tested that the clock carousel is gone
Bug: 262924055
Change-Id: Ia33559e80e64a6d469e164b134a8e2db856ceb70
parent 02263779
Loading
Loading
Loading
Loading
+7 −18
Original line number Diff line number Diff line
@@ -27,17 +27,13 @@
        <include layout="@layout/section_header" />
    </FrameLayout>

    <FrameLayout
    <com.android.wallpaper.picker.DisplayAspectRatioFrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:paddingTop="36dp"
        android:paddingBottom="40dp">

        <com.android.wallpaper.picker.DisplayAspectRatioFrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        <include
            android:id="@+id/lock_preview"
            layout="@layout/wallpaper_preview_card"
@@ -47,13 +43,6 @@

    </com.android.wallpaper.picker.DisplayAspectRatioFrameLayout>

        <com.android.customization.picker.clock.ui.view.ClockCarouselView
            android:id="@+id/clock_carousel_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:visibility="gone" />
    </FrameLayout>

    <LinearLayout
        android:layout_width="match_parent"
+0 −19
Original line number Diff line number Diff line
@@ -24,10 +24,7 @@ import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.get
import androidx.lifecycle.lifecycleScope
import com.android.customization.module.ThemePickerInjector
import com.android.customization.picker.clock.ui.binder.ClockCarouselViewBinder
import com.android.customization.picker.clock.ui.binder.ClockSettingsBinder
import com.android.customization.picker.clock.ui.view.ClockCarouselView
import com.android.systemui.shared.clocks.shared.model.ClockPreviewConstants
import com.android.wallpaper.R
import com.android.wallpaper.model.WallpaperColorsViewModel
import com.android.wallpaper.module.InjectorProvider
@@ -103,31 +100,15 @@ class ClockSettingsFragment : AppbarFragment() {
                        onWallpaperColorChanged = { colors ->
                            colorViewModel.setLockWallpaperColors(colors)
                        },
                        initialExtrasProvider = {
                            Bundle().apply {
                                // Hide the clock from the system UI rendered preview so we can
                                // place the carousel on top of it.
                                putBoolean(ClockPreviewConstants.KEY_HIDE_CLOCK, true)
                            }
                        },
                    ),
                lifecycleOwner = this,
                offsetToStart = displayUtils.isOnWallpaperDisplay(activity),
            )
            .show()

        val carouselView: ClockCarouselView = view.requireViewById(R.id.clock_carousel_view)
        lifecycleScope.launch {
            val registry =
                withContext(Dispatchers.IO) { injector.getClockRegistryProvider(context).get() }
            val clockViewFactory = injector.getClockViewFactory(activity, registry)
            ClockCarouselViewBinder.bind(
                    view = carouselView,
                    viewModel = injector.getClockCarouselViewModel(context, registry),
                    clockViewFactory = { clockId -> clockViewFactory.getView(clockId) },
                    lifecycleOwner = this@ClockSettingsFragment,
                )
                .show()
            ClockSettingsBinder.bind(
                view,
                ViewModelProvider(