Loading packages/SystemUI/src/com/android/systemui/FontStyles.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 /** String tokens for the different GSF font families. */ object FontStyles { const val GSF_LABEL_MEDIUM = "gsf-label-medium" const val GSF_LABEL_LARGE = "gsf-label-large" const val GSF_BODY_MEDIUM = "gsf-body-medium" const val GSF_TITLE_SMALL_EMPHASIZED = "gsf-title-small-emphasized" } packages/SystemUI/src/com/android/systemui/battery/BatteryMeterView.java +3 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import androidx.annotation.VisibleForTesting; import com.android.app.animation.Interpolators; import com.android.systemui.DualToneHandler; import com.android.systemui.FontStyles; import com.android.systemui.battery.unified.BatteryColors; import com.android.systemui.battery.unified.BatteryDrawableState; import com.android.systemui.battery.unified.BatteryLayersDrawable; Loading Loading @@ -387,7 +388,8 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { float fontHeight = mBatteryPercentView.getPaint().getFontMetricsInt(null); mBatteryPercentView.setLineHeight(TypedValue.COMPLEX_UNIT_PX, fontHeight); if (gsfQuickSettings()) { mBatteryPercentView.setTypeface(Typeface.create("gsf-label-large", Typeface.NORMAL)); mBatteryPercentView.setTypeface( Typeface.create(FontStyles.GSF_LABEL_LARGE, Typeface.NORMAL)); } if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor); addView(mBatteryPercentView, new LayoutParams( Loading packages/SystemUI/src/com/android/systemui/qs/QSFooterViewController.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.view.View; import android.widget.TextView; import android.widget.Toast; import com.android.systemui.FontStyles; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.FalsingManager; import com.android.systemui.qs.dagger.QSScope; Loading Loading @@ -68,7 +69,7 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme mBuildText = mView.findViewById(R.id.build); if (gsfQuickSettings()) { mBuildText.setTypeface(Typeface.create("gsf-body-medium", Typeface.NORMAL)); mBuildText.setTypeface(Typeface.create(FontStyles.GSF_BODY_MEDIUM, Typeface.NORMAL)); } mPageIndicator = mView.findViewById(R.id.footer_page_indicator); mEditButton = mView.findViewById(android.R.id.edit); Loading packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java +2 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.android.internal.logging.UiEventLogger; import com.android.systemui.FontSizeUtils; import com.android.systemui.FontStyles; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.qs.QSEditEvent; Loading Loading @@ -314,7 +315,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta v.setMinimumHeight(calculateHeaderMinHeight(context)); if (gsfQuickSettings()) { ((TextView) v.findViewById(android.R.id.title)).setTypeface( Typeface.create("gsf-label-large", Typeface.NORMAL)); Typeface.create(FontStyles.GSF_LABEL_LARGE, Typeface.NORMAL)); } return new Holder(v); } Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +5 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import com.android.app.tracing.traceSection import com.android.settingslib.Utils import com.android.systemui.Flags import com.android.systemui.FontSizeUtils import com.android.systemui.FontStyles import com.android.systemui.animation.Expandable import com.android.systemui.animation.LaunchableView import com.android.systemui.animation.LaunchableViewDelegate Loading Loading @@ -312,9 +313,11 @@ constructor( if (Flags.gsfQuickSettings()) { label.apply { typeface = Typeface.create("gsf-title-small-emphasized", Typeface.NORMAL) typeface = Typeface.create(FontStyles.GSF_TITLE_SMALL_EMPHASIZED, Typeface.NORMAL) } secondaryLabel.apply { typeface = Typeface.create(FontStyles.GSF_LABEL_MEDIUM, Typeface.NORMAL) } secondaryLabel.apply { typeface = Typeface.create("gsf-label-medium", Typeface.NORMAL) } } addView(labelContainer) Loading Loading
packages/SystemUI/src/com/android/systemui/FontStyles.kt 0 → 100644 +28 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 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 /** String tokens for the different GSF font families. */ object FontStyles { const val GSF_LABEL_MEDIUM = "gsf-label-medium" const val GSF_LABEL_LARGE = "gsf-label-large" const val GSF_BODY_MEDIUM = "gsf-body-medium" const val GSF_TITLE_SMALL_EMPHASIZED = "gsf-title-small-emphasized" }
packages/SystemUI/src/com/android/systemui/battery/BatteryMeterView.java +3 −1 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ import androidx.annotation.VisibleForTesting; import com.android.app.animation.Interpolators; import com.android.systemui.DualToneHandler; import com.android.systemui.FontStyles; import com.android.systemui.battery.unified.BatteryColors; import com.android.systemui.battery.unified.BatteryDrawableState; import com.android.systemui.battery.unified.BatteryLayersDrawable; Loading Loading @@ -387,7 +388,8 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { float fontHeight = mBatteryPercentView.getPaint().getFontMetricsInt(null); mBatteryPercentView.setLineHeight(TypedValue.COMPLEX_UNIT_PX, fontHeight); if (gsfQuickSettings()) { mBatteryPercentView.setTypeface(Typeface.create("gsf-label-large", Typeface.NORMAL)); mBatteryPercentView.setTypeface( Typeface.create(FontStyles.GSF_LABEL_LARGE, Typeface.NORMAL)); } if (mTextColor != 0) mBatteryPercentView.setTextColor(mTextColor); addView(mBatteryPercentView, new LayoutParams( Loading
packages/SystemUI/src/com/android/systemui/qs/QSFooterViewController.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.view.View; import android.widget.TextView; import android.widget.Toast; import com.android.systemui.FontStyles; import com.android.systemui.plugins.ActivityStarter; import com.android.systemui.plugins.FalsingManager; import com.android.systemui.qs.dagger.QSScope; Loading Loading @@ -68,7 +69,7 @@ public class QSFooterViewController extends ViewController<QSFooterView> impleme mBuildText = mView.findViewById(R.id.build); if (gsfQuickSettings()) { mBuildText.setTypeface(Typeface.create("gsf-body-medium", Typeface.NORMAL)); mBuildText.setTypeface(Typeface.create(FontStyles.GSF_BODY_MEDIUM, Typeface.NORMAL)); } mPageIndicator = mView.findViewById(R.id.footer_page_indicator); mEditButton = mView.findViewById(android.R.id.edit); Loading
packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java +2 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.android.internal.logging.UiEventLogger; import com.android.systemui.FontSizeUtils; import com.android.systemui.FontStyles; import com.android.systemui.flags.FeatureFlags; import com.android.systemui.flags.Flags; import com.android.systemui.qs.QSEditEvent; Loading Loading @@ -314,7 +315,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta v.setMinimumHeight(calculateHeaderMinHeight(context)); if (gsfQuickSettings()) { ((TextView) v.findViewById(android.R.id.title)).setTypeface( Typeface.create("gsf-label-large", Typeface.NORMAL)); Typeface.create(FontStyles.GSF_LABEL_LARGE, Typeface.NORMAL)); } return new Holder(v); } Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +5 −2 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import com.android.app.tracing.traceSection import com.android.settingslib.Utils import com.android.systemui.Flags import com.android.systemui.FontSizeUtils import com.android.systemui.FontStyles import com.android.systemui.animation.Expandable import com.android.systemui.animation.LaunchableView import com.android.systemui.animation.LaunchableViewDelegate Loading Loading @@ -312,9 +313,11 @@ constructor( if (Flags.gsfQuickSettings()) { label.apply { typeface = Typeface.create("gsf-title-small-emphasized", Typeface.NORMAL) typeface = Typeface.create(FontStyles.GSF_TITLE_SMALL_EMPHASIZED, Typeface.NORMAL) } secondaryLabel.apply { typeface = Typeface.create(FontStyles.GSF_LABEL_MEDIUM, Typeface.NORMAL) } secondaryLabel.apply { typeface = Typeface.create("gsf-label-medium", Typeface.NORMAL) } } addView(labelContainer) Loading