1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.customization.picker.clock.ui.view 17 18 import android.view.View 19 import androidx.annotation.ColorInt 20 import androidx.lifecycle.LifecycleOwner 21 import com.android.systemui.plugins.clocks.ClockAxisStyle 22 import com.android.systemui.plugins.clocks.ClockController 23 24 interface ClockViewFactory { 25 getControllernull26 fun getController(clockId: String): ClockController? 27 28 /** 29 * Reset the large view to its initial state when getting the view. This is because some view 30 * configs, e.g. animation state, might change during the reuse of the clock view in the app. 31 */ 32 fun getLargeView(clockId: String): View 33 34 /** 35 * Reset the small view to its initial state when getting the view. This is because some view 36 * configs, e.g. translation X, might change during the reuse of the clock view in the app. 37 */ 38 fun getSmallView(clockId: String): View 39 40 fun updateColorForAllClocks(@ColorInt seedColor: Int?) 41 42 fun updateColor(clockId: String, @ColorInt seedColor: Int?) 43 44 fun updateFontAxes(clockId: String, settings: ClockAxisStyle) 45 46 fun updateRegionDarkness() 47 48 fun updateTimeFormat(clockId: String) 49 50 fun registerTimeTicker(owner: LifecycleOwner) 51 52 fun onDestroy() 53 54 fun unregisterTimeTicker(owner: LifecycleOwner) 55 } 56