Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/FlexClockView.kt +2 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me val digitLeftTopMap = mutableMapOf<Int, Point>() var maxSingleDigitSize = Point(-1, -1) val lockscreenTranslate = Point(0, 0) val aodTranslate = Point(0, 0) var aodTranslate = Point(0, 0) init { setWillNotDraw(false) Loading @@ -64,8 +64,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me maxSingleDigitSize.y = max(maxSingleDigitSize.y, textView.measuredHeight) } val textView = digitalClockTextViewMap[R.id.HOUR_FIRST_DIGIT]!! aodTranslate.x = -(maxSingleDigitSize.x * AOD_HORIZONTAL_TRANSLATE_RATIO).toInt() aodTranslate.y = (maxSingleDigitSize.y * AOD_VERTICAL_TRANSLATE_RATIO).toInt() aodTranslate = Point(0, 0) return Point( ((maxSingleDigitSize.x + abs(aodTranslate.x)) * 2), ((maxSingleDigitSize.y + abs(aodTranslate.y)) * 2), Loading Loading @@ -162,9 +161,6 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me val AOD_TRANSITION_DURATION = 750L val CHARGING_TRANSITION_DURATION = 300L val AOD_HORIZONTAL_TRANSLATE_RATIO = 0.15F val AOD_VERTICAL_TRANSLATE_RATIO = 0.075F // Use the sign of targetTranslation to control the direction of digit translation fun updateDirectionalTargetTranslate(id: Int, targetTranslation: Point): Point { val outPoint = Point(targetTranslation) Loading packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/SimpleDigitalClockTextView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ open class SimpleDigitalClockTextView( lsFontVariation = ClockFontAxisSetting.toFVar(axes + OPTICAL_SIZE_AXIS) lockScreenPaint.typeface = typefaceCache.getTypefaceForVariant(lsFontVariation) typeface = lockScreenPaint.typeface textAnimator.setTextStyle(fvar = lsFontVariation, animate = true) textAnimator.setTextStyle(fvar = lsFontVariation, animate = false) measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED) recomputeMaxSingleDigitSizes() requestLayout() Loading Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/FlexClockView.kt +2 −6 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me val digitLeftTopMap = mutableMapOf<Int, Point>() var maxSingleDigitSize = Point(-1, -1) val lockscreenTranslate = Point(0, 0) val aodTranslate = Point(0, 0) var aodTranslate = Point(0, 0) init { setWillNotDraw(false) Loading @@ -64,8 +64,7 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me maxSingleDigitSize.y = max(maxSingleDigitSize.y, textView.measuredHeight) } val textView = digitalClockTextViewMap[R.id.HOUR_FIRST_DIGIT]!! aodTranslate.x = -(maxSingleDigitSize.x * AOD_HORIZONTAL_TRANSLATE_RATIO).toInt() aodTranslate.y = (maxSingleDigitSize.y * AOD_VERTICAL_TRANSLATE_RATIO).toInt() aodTranslate = Point(0, 0) return Point( ((maxSingleDigitSize.x + abs(aodTranslate.x)) * 2), ((maxSingleDigitSize.y + abs(aodTranslate.y)) * 2), Loading Loading @@ -162,9 +161,6 @@ class FlexClockView(context: Context, val assets: AssetLoader, messageBuffer: Me val AOD_TRANSITION_DURATION = 750L val CHARGING_TRANSITION_DURATION = 300L val AOD_HORIZONTAL_TRANSLATE_RATIO = 0.15F val AOD_VERTICAL_TRANSLATE_RATIO = 0.075F // Use the sign of targetTranslation to control the direction of digit translation fun updateDirectionalTargetTranslate(id: Int, targetTranslation: Point): Point { val outPoint = Point(targetTranslation) Loading
packages/SystemUI/customization/src/com/android/systemui/shared/clocks/view/SimpleDigitalClockTextView.kt +1 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ open class SimpleDigitalClockTextView( lsFontVariation = ClockFontAxisSetting.toFVar(axes + OPTICAL_SIZE_AXIS) lockScreenPaint.typeface = typefaceCache.getTypefaceForVariant(lsFontVariation) typeface = lockScreenPaint.typeface textAnimator.setTextStyle(fvar = lsFontVariation, animate = true) textAnimator.setTextStyle(fvar = lsFontVariation, animate = false) measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED) recomputeMaxSingleDigitSizes() requestLayout() Loading