Loading src/com/android/customization/picker/clock/ui/binder/ClockSettingsBinder.kt +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import com.android.customization.picker.clock.ui.viewmodel.ClockSettingsViewMode import com.android.customization.picker.color.ui.binder.ColorOptionIconBinder import com.android.customization.picker.common.ui.view.ItemSpacing import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.picker.option.ui.binder.OptionItemBinder import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.mapNotNull Loading Loading @@ -198,6 +199,9 @@ object ClockSettingsBinder { ) .collect { (clockId, size) -> clockHostView.removeAllViews() if (BaseFlags.get().isClockReactiveVariantsEnabled()) { clockViewFactory.setReactiveTouchInteractionEnabled(clockId, true) } val clockView = when (size) { ClockSize.DYNAMIC -> clockViewFactory.getLargeView(clockId) Loading src/com/android/customization/picker/clock/ui/view/ClockCarouselView.kt +9 −11 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.customization.picker.clock.shared.ClockSize import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselItemViewModel import com.android.systemui.plugins.clocks.ClockController import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.picker.FixedWidthDisplayRatioFrameLayout import java.lang.Float.max Loading Loading @@ -408,8 +409,11 @@ class ClockCarouselView( ?: return val clockId = clocks[index].clockId // Add the clock view to the cloc host view // Add the clock view to the clock host view clockHostView.removeAllViews() if (BaseFlags.get().isClockReactiveVariantsEnabled()) { clockViewFactory.setReactiveTouchInteractionEnabled(clockId, false) } val clockView = when (clockSize) { ClockSize.DYNAMIC -> clockViewFactory.getLargeView(clockId) Loading Loading @@ -454,22 +458,16 @@ class ClockCarouselView( it.pivotX = it.width / 2F it.pivotY = it.height / 2F } val controller = clockViewFactory.getController(clockId) if (isMiddleView) { clockScaleView.scaleX = 1f clockScaleView.scaleY = 1f clockViewFactory .getController(clockId) .largeClock .animations .onPickerCarouselSwiping(1F) controller.largeClock.animations.onPickerCarouselSwiping(1F) } else { clockScaleView.scaleX = CLOCK_CAROUSEL_VIEW_SCALE clockScaleView.scaleY = CLOCK_CAROUSEL_VIEW_SCALE clockViewFactory .getController(clockId) .largeClock .animations .onPickerCarouselSwiping(0F) controller.largeClock.animations.onPickerCarouselSwiping(0F) } } Loading src/com/android/customization/picker/clock/ui/view/ClockViewFactory.kt +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ interface ClockViewFactory { */ fun getSmallView(clockId: String): View /** Enables or disables the reactive swipe interaction */ fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) fun updateColorForAllClocks(@ColorInt seedColor: Int?) fun updateColor(clockId: String, @ColorInt seedColor: Int?) Loading src/com/android/customization/picker/clock/ui/view/ClockViewFactoryImpl.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.plugins.clocks.WeatherData import com.android.systemui.shared.clocks.ClockRegistry import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.util.TimeUtils.TimeTicker import java.util.concurrent.ConcurrentHashMap Loading Loading @@ -81,6 +82,14 @@ class ClockViewFactoryImpl( return smallClockFrame } /** Enables or disables the reactive swipe interaction */ override fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) { check(BaseFlags.get().isClockReactiveVariantsEnabled()) { "isClockReactiveVariantsEnabled is disabled" } getController(clockId).events.isReactiveTouchInteractionEnabled = enable } private fun createSmallClockFrame(): FrameLayout { val smallClockFrame = FrameLayout(appContext) val layoutParams = Loading tests/robotests/src/com/android/customization/picker/clock/ui/FakeClockViewFactory.kt +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ class FakeClockViewFactory( override fun getController(clockId: String): ClockController = clockControllers.get(clockId)!! override fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) { TODO("Not yet implemented") } override fun getLargeView(clockId: String): View { TODO("Not yet implemented") } Loading Loading
src/com/android/customization/picker/clock/ui/binder/ClockSettingsBinder.kt +4 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import com.android.customization.picker.clock.ui.viewmodel.ClockSettingsViewMode import com.android.customization.picker.color.ui.binder.ColorOptionIconBinder import com.android.customization.picker.common.ui.view.ItemSpacing import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.picker.option.ui.binder.OptionItemBinder import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.mapNotNull Loading Loading @@ -198,6 +199,9 @@ object ClockSettingsBinder { ) .collect { (clockId, size) -> clockHostView.removeAllViews() if (BaseFlags.get().isClockReactiveVariantsEnabled()) { clockViewFactory.setReactiveTouchInteractionEnabled(clockId, true) } val clockView = when (size) { ClockSize.DYNAMIC -> clockViewFactory.getLargeView(clockId) Loading
src/com/android/customization/picker/clock/ui/view/ClockCarouselView.kt +9 −11 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ import com.android.customization.picker.clock.shared.ClockSize import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselItemViewModel import com.android.systemui.plugins.clocks.ClockController import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.picker.FixedWidthDisplayRatioFrameLayout import java.lang.Float.max Loading Loading @@ -408,8 +409,11 @@ class ClockCarouselView( ?: return val clockId = clocks[index].clockId // Add the clock view to the cloc host view // Add the clock view to the clock host view clockHostView.removeAllViews() if (BaseFlags.get().isClockReactiveVariantsEnabled()) { clockViewFactory.setReactiveTouchInteractionEnabled(clockId, false) } val clockView = when (clockSize) { ClockSize.DYNAMIC -> clockViewFactory.getLargeView(clockId) Loading Loading @@ -454,22 +458,16 @@ class ClockCarouselView( it.pivotX = it.width / 2F it.pivotY = it.height / 2F } val controller = clockViewFactory.getController(clockId) if (isMiddleView) { clockScaleView.scaleX = 1f clockScaleView.scaleY = 1f clockViewFactory .getController(clockId) .largeClock .animations .onPickerCarouselSwiping(1F) controller.largeClock.animations.onPickerCarouselSwiping(1F) } else { clockScaleView.scaleX = CLOCK_CAROUSEL_VIEW_SCALE clockScaleView.scaleY = CLOCK_CAROUSEL_VIEW_SCALE clockViewFactory .getController(clockId) .largeClock .animations .onPickerCarouselSwiping(0F) controller.largeClock.animations.onPickerCarouselSwiping(0F) } } Loading
src/com/android/customization/picker/clock/ui/view/ClockViewFactory.kt +3 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ interface ClockViewFactory { */ fun getSmallView(clockId: String): View /** Enables or disables the reactive swipe interaction */ fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) fun updateColorForAllClocks(@ColorInt seedColor: Int?) fun updateColor(clockId: String, @ColorInt seedColor: Int?) Loading
src/com/android/customization/picker/clock/ui/view/ClockViewFactoryImpl.kt +9 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import com.android.systemui.plugins.clocks.ClockController import com.android.systemui.plugins.clocks.WeatherData import com.android.systemui.shared.clocks.ClockRegistry import com.android.themepicker.R import com.android.wallpaper.config.BaseFlags import com.android.wallpaper.util.TimeUtils.TimeTicker import java.util.concurrent.ConcurrentHashMap Loading Loading @@ -81,6 +82,14 @@ class ClockViewFactoryImpl( return smallClockFrame } /** Enables or disables the reactive swipe interaction */ override fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) { check(BaseFlags.get().isClockReactiveVariantsEnabled()) { "isClockReactiveVariantsEnabled is disabled" } getController(clockId).events.isReactiveTouchInteractionEnabled = enable } private fun createSmallClockFrame(): FrameLayout { val smallClockFrame = FrameLayout(appContext) val layoutParams = Loading
tests/robotests/src/com/android/customization/picker/clock/ui/FakeClockViewFactory.kt +4 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,10 @@ class FakeClockViewFactory( override fun getController(clockId: String): ClockController = clockControllers.get(clockId)!! override fun setReactiveTouchInteractionEnabled(clockId: String, enable: Boolean) { TODO("Not yet implemented") } override fun getLargeView(clockId: String): View { TODO("Not yet implemented") } Loading