Loading packages/SystemUI/res/drawable/list_item_background.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2023 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@*android:drawable/list_choice_background_material" /> <item android:drawable="@android:color/transparent" /> </selector> No newline at end of file packages/SystemUI/res/layout/keyboard_shortcut_app_item.xml +3 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ <com.android.systemui.statusbar.KeyboardShortcutAppItemLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:background="@drawable/list_item_background" android:focusable="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="48dp" Loading Loading @@ -55,6 +57,5 @@ android:layout_alignParentEnd="true" android:textSize="14sp" android:scrollHorizontally="false" android:layout_centerVertical="true" android:focusable="true"/> android:layout_centerVertical="true"/> </com.android.systemui.statusbar.KeyboardShortcutAppItemLayout> packages/SystemUI/res/layout/keyboard_shortcuts_category_title.xml +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ ~ limitations under the License --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="14sp" android:fontFamily="sans-serif-medium" android:importantForAccessibility="yes" android:paddingStart="24dp" android:paddingTop="20dp" android:paddingEnd="24dp" Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java +16 −4 Original line number Diff line number Diff line Loading @@ -440,10 +440,15 @@ public final class KeyboardShortcuts { mContext.getString(R.string.keyboard_shortcut_group_system_back), KeyEvent.KEYCODE_DEL, KeyEvent.META_META_ON)); // Some devices (like TV) don't have recents if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_hasRecents)) { systemGroup.addItem(new KeyboardShortcutInfo( mContext.getString(R.string.keyboard_shortcut_group_system_recents), KeyEvent.KEYCODE_TAB, KeyEvent.META_ALT_ON)); } systemGroup.addItem(new KeyboardShortcutInfo( mContext.getString( R.string.keyboard_shortcut_group_system_notifications), Loading Loading @@ -683,8 +688,10 @@ public final class KeyboardShortcuts { ViewGroup shortcutItemsContainer = (ViewGroup) shortcutView .findViewById(R.id.keyboard_shortcuts_item_container); final int shortcutKeysSize = shortcutKeys.size(); final List<String> humanReadableShortcuts = new ArrayList<>(); for (int k = 0; k < shortcutKeysSize; k++) { StringDrawableContainer shortcutRepresentation = shortcutKeys.get(k); humanReadableShortcuts.add(shortcutRepresentation.mString); if (shortcutRepresentation.mDrawable != null) { ImageView shortcutKeyIconView = (ImageView) inflater.inflate( R.layout.keyboard_shortcuts_key_icon_view, shortcutItemsContainer, Loading Loading @@ -714,6 +721,11 @@ public final class KeyboardShortcuts { shortcutItemsContainer.addView(shortcutKeyTextView); } } CharSequence contentDescription = info.getLabel(); if (!humanReadableShortcuts.isEmpty()) { contentDescription += ": " + String.join(", ", humanReadableShortcuts); } shortcutView.setContentDescription(contentDescription); shortcutContainer.addView(shortcutView); } keyboardShortcutsLayout.addView(shortcutContainer); Loading packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +8 −2 Original line number Diff line number Diff line Loading @@ -27,11 +27,12 @@ import com.android.systemui.CoreStartable; import com.android.systemui.assist.AssistManager; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.CommandQueue; import javax.inject.Inject; import com.android.systemui.statusbar.KeyboardShortcuts; import dagger.Lazy; import javax.inject.Inject; /** * Status bar implementation for "large screen" products that mostly present no on-screen nav. * Serves as a collection of UI components, rather than showing its own UI. Loading Loading @@ -78,4 +79,9 @@ public class TvStatusBar implements CoreStartable, CommandQueue.Callbacks { new Intent(ACTION_SHOW_PIP_MENU).setPackage(mContext.getPackageName()), SYSTEMUI_PERMISSION); } @Override public void toggleKeyboardShortcutsMenu(int deviceId) { KeyboardShortcuts.show(mContext, deviceId); } } Loading
packages/SystemUI/res/drawable/list_item_background.xml 0 → 100644 +21 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2023 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:drawable="@*android:drawable/list_choice_background_material" /> <item android:drawable="@android:color/transparent" /> </selector> No newline at end of file
packages/SystemUI/res/layout/keyboard_shortcut_app_item.xml +3 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ <com.android.systemui.statusbar.KeyboardShortcutAppItemLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:background="@drawable/list_item_background" android:focusable="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="48dp" Loading Loading @@ -55,6 +57,5 @@ android:layout_alignParentEnd="true" android:textSize="14sp" android:scrollHorizontally="false" android:layout_centerVertical="true" android:focusable="true"/> android:layout_centerVertical="true"/> </com.android.systemui.statusbar.KeyboardShortcutAppItemLayout>
packages/SystemUI/res/layout/keyboard_shortcuts_category_title.xml +2 −1 Original line number Diff line number Diff line Loading @@ -16,10 +16,11 @@ ~ limitations under the License --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_width="match_parent" android:layout_height="match_parent" android:textSize="14sp" android:fontFamily="sans-serif-medium" android:importantForAccessibility="yes" android:paddingStart="24dp" android:paddingTop="20dp" android:paddingEnd="24dp" Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyboardShortcuts.java +16 −4 Original line number Diff line number Diff line Loading @@ -440,10 +440,15 @@ public final class KeyboardShortcuts { mContext.getString(R.string.keyboard_shortcut_group_system_back), KeyEvent.KEYCODE_DEL, KeyEvent.META_META_ON)); // Some devices (like TV) don't have recents if (mContext.getResources().getBoolean(com.android.internal.R.bool.config_hasRecents)) { systemGroup.addItem(new KeyboardShortcutInfo( mContext.getString(R.string.keyboard_shortcut_group_system_recents), KeyEvent.KEYCODE_TAB, KeyEvent.META_ALT_ON)); } systemGroup.addItem(new KeyboardShortcutInfo( mContext.getString( R.string.keyboard_shortcut_group_system_notifications), Loading Loading @@ -683,8 +688,10 @@ public final class KeyboardShortcuts { ViewGroup shortcutItemsContainer = (ViewGroup) shortcutView .findViewById(R.id.keyboard_shortcuts_item_container); final int shortcutKeysSize = shortcutKeys.size(); final List<String> humanReadableShortcuts = new ArrayList<>(); for (int k = 0; k < shortcutKeysSize; k++) { StringDrawableContainer shortcutRepresentation = shortcutKeys.get(k); humanReadableShortcuts.add(shortcutRepresentation.mString); if (shortcutRepresentation.mDrawable != null) { ImageView shortcutKeyIconView = (ImageView) inflater.inflate( R.layout.keyboard_shortcuts_key_icon_view, shortcutItemsContainer, Loading Loading @@ -714,6 +721,11 @@ public final class KeyboardShortcuts { shortcutItemsContainer.addView(shortcutKeyTextView); } } CharSequence contentDescription = info.getLabel(); if (!humanReadableShortcuts.isEmpty()) { contentDescription += ": " + String.join(", ", humanReadableShortcuts); } shortcutView.setContentDescription(contentDescription); shortcutContainer.addView(shortcutView); } keyboardShortcutsLayout.addView(shortcutContainer); Loading
packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java +8 −2 Original line number Diff line number Diff line Loading @@ -27,11 +27,12 @@ import com.android.systemui.CoreStartable; import com.android.systemui.assist.AssistManager; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.statusbar.CommandQueue; import javax.inject.Inject; import com.android.systemui.statusbar.KeyboardShortcuts; import dagger.Lazy; import javax.inject.Inject; /** * Status bar implementation for "large screen" products that mostly present no on-screen nav. * Serves as a collection of UI components, rather than showing its own UI. Loading Loading @@ -78,4 +79,9 @@ public class TvStatusBar implements CoreStartable, CommandQueue.Callbacks { new Intent(ACTION_SHOW_PIP_MENU).setPackage(mContext.getPackageName()), SYSTEMUI_PERMISSION); } @Override public void toggleKeyboardShortcutsMenu(int deviceId) { KeyboardShortcuts.show(mContext, deviceId); } }