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

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

Merge "Show and hide smartspace (2/3)" into udc-dev am: a0636139

parents 36c82537 a0636139
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@ object ClockCarouselViewBinder {
        viewModel: ClockCarouselViewModel,
        clockViewFactory: ClockViewFactory,
        lifecycleOwner: LifecycleOwner,
        hideSmartspace: (Boolean) -> Unit,
    ) {
        carouselView.setClockViewFactory(clockViewFactory)
        val singleClockHostView =
@@ -54,16 +53,7 @@ object ClockCarouselViewBinder {
                        carouselView.setUpClockCarouselView(
                            clockSize = size,
                            clockIds = allClockIds,
                            onClockSelected = { clockId ->
                                viewModel.setSelectedClock(clockId)
                                val hasCustomWeatherDataDisplay =
                                    clockViewFactory
                                        .getController(clockId)
                                        .largeClock
                                        .config
                                        .hasCustomWeatherDataDisplay
                                hideSmartspace(hasCustomWeatherDataDisplay)
                            },
                            onClockSelected = { clockId -> viewModel.setSelectedClock(clockId) },
                        )
                    }
                }
+0 −15
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ package com.android.customization.picker.preview.ui.section
import android.app.WallpaperManager
import android.content.Context
import android.graphics.Rect
import android.os.Bundle
import android.view.TouchDelegate
import android.view.View
import android.view.View.OnAttachStateChangeListener
@@ -39,7 +38,6 @@ import com.android.customization.picker.clock.ui.fragment.ClockSettingsFragment
import com.android.customization.picker.clock.ui.view.ClockCarouselView
import com.android.customization.picker.clock.ui.view.ClockViewFactory
import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel
import com.android.systemui.shared.quickaffordance.shared.model.KeyguardPreviewConstants
import com.android.wallpaper.R
import com.android.wallpaper.model.CustomizationSectionController.CustomizationSectionNavigationController
import com.android.wallpaper.model.WallpaperColorsViewModel
@@ -163,7 +161,6 @@ class PreviewWithClockCarouselSectionController(
                                    viewModel = viewModel,
                                    clockViewFactory = clockViewFactory,
                                    lifecycleOwner = lifecycleOwner,
                                    hideSmartspace = ::hideSmartspace,
                                )
                                if (onAttachStateChangeListener != null) {
                                    carouselView.carousel.removeOnAttachStateChangeListener(
@@ -182,16 +179,4 @@ class PreviewWithClockCarouselSectionController(

        return view
    }

    private fun hideSmartspace(hide: Boolean) {
        previewViewBinding.sendMessage(
            KeyguardPreviewConstants.MESSAGE_ID_HIDE_SMART_SPACE,
            Bundle().apply {
                putBoolean(
                    KeyguardPreviewConstants.KEY_HIDE_SMART_SPACE,
                    hide,
                )
            }
        )
    }
}