Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt +22 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import javax.inject.Inject import kotlin.math.max import kotlinx.coroutines.launch Loading Loading @@ -127,6 +128,7 @@ constructor( runTransition(constraintLayout, transition, Config.DEFAULT) { // Add and remove views of sections that are not contained by the other. blueprint.replaceViews(prevBluePrint, constraintLayout) logAlphaVisibilityOfAppliedConstraintSet(cs, clockViewModel) cs.applyTo(constraintLayout) } Loading @@ -153,6 +155,7 @@ constructor( ), transition, ) { logAlphaVisibilityOfAppliedConstraintSet(cs, clockViewModel) cs.applyTo(constraintLayout) } Trace.endSection() Loading Loading @@ -205,4 +208,23 @@ constructor( apply() } } private fun logAlphaVisibilityOfAppliedConstraintSet( cs: ConstraintSet, viewModel: KeyguardClockViewModel ) { if (!DEBUG || viewModel.clock == null) return val smallClockViewId = R.id.lockscreen_clock_view val largeClockViewId = viewModel.clock!!.largeClock.layout.views[0].id Log.i( TAG, "applyCsToSmallClock: vis=${cs.getVisibility(smallClockViewId)} " + "alpha=${cs.getConstraint(smallClockViewId).propertySet}" ) Log.i( TAG, "applyCsToLargeClock: vis=${cs.getVisibility(largeClockViewId)} " + "alpha=${cs.getConstraint(largeClockViewId).propertySet}" ) } } packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +8 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ internal fun ConstraintSet.setVisibility( visibility: Int, ) = views.forEach { view -> this.setVisibility(view.id, visibility) } internal fun ConstraintSet.setAlpha( views: Iterable<View>, alpha: Float, ) = views.forEach { view -> this.setAlpha(view.id, alpha) } open class ClockSection @Inject constructor( Loading Loading @@ -101,6 +106,8 @@ constructor( return constraintSet.apply { setVisibility(getTargetClockFace(clock).views, VISIBLE) setVisibility(getNonTargetClockFace(clock).views, GONE) setAlpha(getTargetClockFace(clock).views, 1F) setAlpha(getNonTargetClockFace(clock).views, 0F) if (!keyguardClockViewModel.useLargeClock) { connect(sharedR.id.bc_smartspace_view, TOP, sharedR.id.date_smartspace_view, BOTTOM) } Loading Loading @@ -179,7 +186,7 @@ constructor( context.resources.getDimensionPixelSize(customizationR.dimen.clock_padding_start) + context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal) ) var smallClockTopMargin = val smallClockTopMargin = if (splitShadeStateController.shouldUseSplitNotificationShade(context.resources)) { context.resources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin) } else { Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/transitions/ClockSizeTransition.kt +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ class ClockSizeTransition( arrayOf(PROP_VISIBILITY, PROP_ALPHA, PROP_BOUNDS, SMARTSPACE_BOUNDS) private val DEBUG = true private val TAG = ClockFaceInTransition::class.simpleName!! private val TAG = VisibilityBoundsTransition::class.simpleName!! } } Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBlueprintViewBinder.kt +22 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardBlueprintViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.res.R import javax.inject.Inject import kotlin.math.max import kotlinx.coroutines.launch Loading Loading @@ -127,6 +128,7 @@ constructor( runTransition(constraintLayout, transition, Config.DEFAULT) { // Add and remove views of sections that are not contained by the other. blueprint.replaceViews(prevBluePrint, constraintLayout) logAlphaVisibilityOfAppliedConstraintSet(cs, clockViewModel) cs.applyTo(constraintLayout) } Loading @@ -153,6 +155,7 @@ constructor( ), transition, ) { logAlphaVisibilityOfAppliedConstraintSet(cs, clockViewModel) cs.applyTo(constraintLayout) } Trace.endSection() Loading Loading @@ -205,4 +208,23 @@ constructor( apply() } } private fun logAlphaVisibilityOfAppliedConstraintSet( cs: ConstraintSet, viewModel: KeyguardClockViewModel ) { if (!DEBUG || viewModel.clock == null) return val smallClockViewId = R.id.lockscreen_clock_view val largeClockViewId = viewModel.clock!!.largeClock.layout.views[0].id Log.i( TAG, "applyCsToSmallClock: vis=${cs.getVisibility(smallClockViewId)} " + "alpha=${cs.getConstraint(smallClockViewId).propertySet}" ) Log.i( TAG, "applyCsToLargeClock: vis=${cs.getVisibility(largeClockViewId)} " + "alpha=${cs.getConstraint(largeClockViewId).propertySet}" ) } }
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/ClockSection.kt +8 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ internal fun ConstraintSet.setVisibility( visibility: Int, ) = views.forEach { view -> this.setVisibility(view.id, visibility) } internal fun ConstraintSet.setAlpha( views: Iterable<View>, alpha: Float, ) = views.forEach { view -> this.setAlpha(view.id, alpha) } open class ClockSection @Inject constructor( Loading Loading @@ -101,6 +106,8 @@ constructor( return constraintSet.apply { setVisibility(getTargetClockFace(clock).views, VISIBLE) setVisibility(getNonTargetClockFace(clock).views, GONE) setAlpha(getTargetClockFace(clock).views, 1F) setAlpha(getNonTargetClockFace(clock).views, 0F) if (!keyguardClockViewModel.useLargeClock) { connect(sharedR.id.bc_smartspace_view, TOP, sharedR.id.date_smartspace_view, BOTTOM) } Loading Loading @@ -179,7 +186,7 @@ constructor( context.resources.getDimensionPixelSize(customizationR.dimen.clock_padding_start) + context.resources.getDimensionPixelSize(R.dimen.status_view_margin_horizontal) ) var smallClockTopMargin = val smallClockTopMargin = if (splitShadeStateController.shouldUseSplitNotificationShade(context.resources)) { context.resources.getDimensionPixelSize(R.dimen.keyguard_split_shade_top_margin) } else { Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/transitions/ClockSizeTransition.kt +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ class ClockSizeTransition( arrayOf(PROP_VISIBILITY, PROP_ALPHA, PROP_BOUNDS, SMARTSPACE_BOUNDS) private val DEBUG = true private val TAG = ClockFaceInTransition::class.simpleName!! private val TAG = VisibilityBoundsTransition::class.simpleName!! } } Loading