Loading packages/SystemUI/animation/src/com/android/systemui/animation/TextInterpolator.kt +7 −1 Original line number Diff line number Diff line Loading @@ -485,7 +485,13 @@ class TextInterpolator( val out = mutableListOf<List<PositionedGlyphs>>() for (lineNo in 0 until layout.lineCount) { // Shape all lines. val lineStart = layout.getLineStart(lineNo) val count = layout.getLineEnd(lineNo) - lineStart var count = layout.getLineEnd(lineNo) - lineStart // Do not render the last character in the line if it's a newline and unprintable val last = lineStart + count - 1 if (last > lineStart && last < layout.text.length && layout.text[last] == '\n') { count-- } val runs = mutableListOf<PositionedGlyphs>() TextShaper.shapeText(layout.text, lineStart, count, layout.textDirectionHeuristic, paint) { _, _, glyphs, _ -> Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt +13 −8 Original line number Diff line number Diff line Loading @@ -13,9 +13,9 @@ */ package com.android.systemui.plugins import android.content.res.Resources import android.graphics.drawable.Drawable import android.view.View import com.android.internal.colorextraction.ColorExtractor import com.android.systemui.plugins.annotations.ProvidesInterface import java.io.PrintWriter import java.util.Locale Loading Loading @@ -57,7 +57,15 @@ interface Clock { val events: ClockEvents /** Triggers for various animations */ val animation: ClockAnimation val animations: ClockAnimations /** Initializes various rendering parameters. If never called, provides reasonable defaults. */ fun initialize(resources: Resources, dozeFraction: Float, foldFraction: Float) { events.onColorPaletteChanged(resources) animations.doze(dozeFraction) animations.fold(foldFraction) events.onTimeTick() } /** Optional method for dumping debug information */ fun dump(pw: PrintWriter) { } Loading @@ -80,15 +88,12 @@ interface ClockEvents { /** Call whenever font settings change */ fun onFontSettingChanged() { } /** Call whenever the color pallete should update */ fun onColorPaletteChanged(palette: ColorExtractor.GradientColors) { } /** Call whenever the color palette should update */ fun onColorPaletteChanged(resources: Resources) { } } /** Methods which trigger various clock animations */ interface ClockAnimation { /** Initializes the doze & fold animation positions. Defaults to neither folded nor dozing. */ fun initialize(dozeFraction: Float, foldFraction: Float) { } interface ClockAnimations { /** Runs an enter animation (if any) */ fun enter() { } Loading packages/SystemUI/res-keyguard/font/clock.xmldeleted 100644 → 0 +0 −28 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ** ** Copyright 2020, 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. */ --> <!-- ** AOD/LockScreen Clock font. ** Should include all numeric glyphs in all supported locales. ** Recommended: font with variable width to support AOD => LS animations --> <!-- TODO: Remove when clock migration complete --> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:typeface="monospace"/> </font-family> No newline at end of file packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +2 −30 Original line number Diff line number Diff line Loading @@ -31,42 +31,14 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:paddingStart="@dimen/clock_padding_start"> <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:gravity="start" android:textSize="@dimen/clock_text_size" android:fontFamily="@font/clock" android:elegantTextHeight="false" android:singleLine="true" android:fontFeatureSettings="pnum" chargeAnimationDelay="350" dozeWeight="200" lockScreenWeight="400" /> </FrameLayout> <FrameLayout android:id="@+id/lockscreen_clock_view_large" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="match_parent" android:layout_below="@id/keyguard_slice_view" android:paddingTop="@dimen/keyguard_large_clock_top_padding" android:visibility="gone"> <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view_large" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center_horizontal" android:textSize="@dimen/large_clock_text_size" android:fontFamily="@font/clock" android:typeface="monospace" android:elegantTextHeight="false" chargeAnimationDelay="200" dozeWeight="200" lockScreenWeight="400" /> </FrameLayout> <!-- Not quite optimal but needed to translate these items as a group. The Loading packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:id="@+id/time_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/clock" android:fontFamily="@*android:string/config_clockFontFamily" android:includeFontPadding="false" android:textColor="@android:color/white" android:format12Hour="@string/dream_time_complication_12_hr_time_format" Loading Loading
packages/SystemUI/animation/src/com/android/systemui/animation/TextInterpolator.kt +7 −1 Original line number Diff line number Diff line Loading @@ -485,7 +485,13 @@ class TextInterpolator( val out = mutableListOf<List<PositionedGlyphs>>() for (lineNo in 0 until layout.lineCount) { // Shape all lines. val lineStart = layout.getLineStart(lineNo) val count = layout.getLineEnd(lineNo) - lineStart var count = layout.getLineEnd(lineNo) - lineStart // Do not render the last character in the line if it's a newline and unprintable val last = lineStart + count - 1 if (last > lineStart && last < layout.text.length && layout.text[last] == '\n') { count-- } val runs = mutableListOf<PositionedGlyphs>() TextShaper.shapeText(layout.text, lineStart, count, layout.textDirectionHeuristic, paint) { _, _, glyphs, _ -> Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/ClockProviderPlugin.kt +13 −8 Original line number Diff line number Diff line Loading @@ -13,9 +13,9 @@ */ package com.android.systemui.plugins import android.content.res.Resources import android.graphics.drawable.Drawable import android.view.View import com.android.internal.colorextraction.ColorExtractor import com.android.systemui.plugins.annotations.ProvidesInterface import java.io.PrintWriter import java.util.Locale Loading Loading @@ -57,7 +57,15 @@ interface Clock { val events: ClockEvents /** Triggers for various animations */ val animation: ClockAnimation val animations: ClockAnimations /** Initializes various rendering parameters. If never called, provides reasonable defaults. */ fun initialize(resources: Resources, dozeFraction: Float, foldFraction: Float) { events.onColorPaletteChanged(resources) animations.doze(dozeFraction) animations.fold(foldFraction) events.onTimeTick() } /** Optional method for dumping debug information */ fun dump(pw: PrintWriter) { } Loading @@ -80,15 +88,12 @@ interface ClockEvents { /** Call whenever font settings change */ fun onFontSettingChanged() { } /** Call whenever the color pallete should update */ fun onColorPaletteChanged(palette: ColorExtractor.GradientColors) { } /** Call whenever the color palette should update */ fun onColorPaletteChanged(resources: Resources) { } } /** Methods which trigger various clock animations */ interface ClockAnimation { /** Initializes the doze & fold animation positions. Defaults to neither folded nor dozing. */ fun initialize(dozeFraction: Float, foldFraction: Float) { } interface ClockAnimations { /** Runs an enter animation (if any) */ fun enter() { } Loading
packages/SystemUI/res-keyguard/font/clock.xmldeleted 100644 → 0 +0 −28 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ** ** Copyright 2020, 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. */ --> <!-- ** AOD/LockScreen Clock font. ** Should include all numeric glyphs in all supported locales. ** Recommended: font with variable width to support AOD => LS animations --> <!-- TODO: Remove when clock migration complete --> <font-family xmlns:android="http://schemas.android.com/apk/res/android"> <font android:typeface="monospace"/> </font-family> No newline at end of file
packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml +2 −30 Original line number Diff line number Diff line Loading @@ -31,42 +31,14 @@ android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:paddingStart="@dimen/clock_padding_start"> <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="start" android:gravity="start" android:textSize="@dimen/clock_text_size" android:fontFamily="@font/clock" android:elegantTextHeight="false" android:singleLine="true" android:fontFeatureSettings="pnum" chargeAnimationDelay="350" dozeWeight="200" lockScreenWeight="400" /> </FrameLayout> <FrameLayout android:id="@+id/lockscreen_clock_view_large" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_height="match_parent" android:layout_below="@id/keyguard_slice_view" android:paddingTop="@dimen/keyguard_large_clock_top_padding" android:visibility="gone"> <com.android.systemui.shared.clocks.AnimatableClockView android:id="@+id/animatable_clock_view_large" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center_horizontal" android:textSize="@dimen/large_clock_text_size" android:fontFamily="@font/clock" android:typeface="monospace" android:elegantTextHeight="false" chargeAnimationDelay="200" dozeWeight="200" lockScreenWeight="400" /> </FrameLayout> <!-- Not quite optimal but needed to translate these items as a group. The Loading
packages/SystemUI/res/layout/dream_overlay_complication_clock_time.xml +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ android:id="@+id/time_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="@font/clock" android:fontFamily="@*android:string/config_clockFontFamily" android:includeFontPadding="false" android:textColor="@android:color/white" android:format12Hour="@string/dream_time_complication_12_hr_time_format" Loading