diff --git a/quickstep/res/layout/keyboard_quick_switch_desktop_taskview.xml b/quickstep/res/layout/keyboard_quick_switch_desktop_taskview.xml index 71c782d7e0..db47ff08ba 100644 --- a/quickstep/res/layout/keyboard_quick_switch_desktop_taskview.xml +++ b/quickstep/res/layout/keyboard_quick_switch_desktop_taskview.xml @@ -48,13 +48,13 @@ app:layout_constraintVertical_chainStyle="packed" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toTopOf="@id/text" + app:layout_constraintBottom_toTopOf="@id/small_text" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"/> findViewById(R.id.text).setText( + desktopButton.findViewById(R.id.small_text).setText( resources.getString(R.string.quick_switch_desktop)); } mDisplayingRecentTasks = !groupTasks.isEmpty() || useDesktopTaskView; diff --git a/quickstep/src/com/android/launcher3/taskbar/TypefaceUtils.kt b/quickstep/src/com/android/launcher3/taskbar/TypefaceUtils.kt new file mode 100644 index 0000000000..fa551b84ad --- /dev/null +++ b/quickstep/src/com/android/launcher3/taskbar/TypefaceUtils.kt @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2025 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.launcher3.taskbar + +import android.graphics.Typeface +import android.widget.TextView +import com.android.launcher3.Flags + +/** + * Helper util class to set pre-defined typefaces to textviews + * + * If the typeface font family is already defined here, you can just reuse it directly. Otherwise, + * please define it here for future use. You do not need to define the font style. If you need + * anything other than [Typeface.NORMAL], pass it inline when calling [setTypeface] + */ +class TypefaceUtils { + + companion object { + const val FONT_FAMILY_HEADLINE_LARGE_EMPHASIZED = "variable-headline-large-emphasized" + const val FONT_FAMILY_LABEL_LARGE_BASELINE = "variable-label-large" + + @JvmStatic + @JvmOverloads + fun setTypeface( + textView: TextView?, + fontFamilyName: String, + fontStyle: Int = Typeface.NORMAL, + ) { + if (!Flags.expressiveThemeInTaskbarAndNavigation()) return + textView?.typeface = Typeface.create(fontFamilyName, fontStyle) + } + } +}