Merge "Adds way to hide the clock in lock screen preview." into tm-qpr-dev am: 7c1e07e54c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21353673 Change-Id: I317c755dbcfae07b8c89b1be951e4fe57d907d71 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2023 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.android.systemui.shared.clocks.shared.model
|
||||||
|
|
||||||
|
object ClockPreviewConstants {
|
||||||
|
const val KEY_HIDE_CLOCK = "hide_clock"
|
||||||
|
}
|
||||||
@@ -38,6 +38,7 @@ import com.android.systemui.dagger.qualifiers.Application
|
|||||||
import com.android.systemui.dagger.qualifiers.Main
|
import com.android.systemui.dagger.qualifiers.Main
|
||||||
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel
|
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel
|
||||||
import com.android.systemui.shared.clocks.ClockRegistry
|
import com.android.systemui.shared.clocks.ClockRegistry
|
||||||
|
import com.android.systemui.shared.clocks.shared.model.ClockPreviewConstants
|
||||||
import com.android.systemui.shared.quickaffordance.shared.model.KeyguardQuickAffordancePreviewConstants
|
import com.android.systemui.shared.quickaffordance.shared.model.KeyguardQuickAffordancePreviewConstants
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBottomAreaView
|
import com.android.systemui.statusbar.phone.KeyguardBottomAreaView
|
||||||
import dagger.assisted.Assisted
|
import dagger.assisted.Assisted
|
||||||
@@ -69,6 +70,8 @@ constructor(
|
|||||||
KeyguardQuickAffordancePreviewConstants.KEY_HIGHLIGHT_QUICK_AFFORDANCES,
|
KeyguardQuickAffordancePreviewConstants.KEY_HIGHLIGHT_QUICK_AFFORDANCES,
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
private val shouldHideClock: Boolean =
|
||||||
|
bundle.getBoolean(ClockPreviewConstants.KEY_HIDE_CLOCK, false)
|
||||||
|
|
||||||
private var host: SurfaceControlViewHost
|
private var host: SurfaceControlViewHost
|
||||||
|
|
||||||
@@ -104,7 +107,9 @@ constructor(
|
|||||||
val rootView = FrameLayout(context)
|
val rootView = FrameLayout(context)
|
||||||
|
|
||||||
setUpBottomArea(rootView)
|
setUpBottomArea(rootView)
|
||||||
|
if (!shouldHideClock) {
|
||||||
setUpClock(rootView)
|
setUpClock(rootView)
|
||||||
|
}
|
||||||
|
|
||||||
rootView.measure(
|
rootView.measure(
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
|
|||||||
Reference in New Issue
Block a user