Loading packages/SystemUI/res/values/strings.xml +16 −0 Original line number Diff line number Diff line Loading @@ -3543,10 +3543,26 @@ shows the user which keyboard shortcuts they can use. The "System" shortcuts are for example "Take a screenshot" or "Go back". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system">System</string> <!-- Title of the keyboard shortcut helper category "System controls". The helper is a component that shows the user which keyboard shortcuts they can use. The "System controls" shortcuts are for example "Go to home screen" or "App apps search". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system_controls">System controls</string> <!-- Title of the keyboard shortcut helper category "System apps". The helper is a component that shows the user which keyboard shortcuts they can use. The "System apps" shortcuts are for example "Settings" or "Take a note". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system_apps">System apps</string> <!-- Title of the keyboard shortcut helper category "Multitasking". The helper is a component that shows the user which keyboard shortcuts they can use. The "Multitasking" shortcuts are for example "Enter split screen". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_multitasking">Multitasking</string> <!-- Title of the keyboard shortcut helper category "Recent apps". The helper is a component that shows the user which keyboard shortcuts they can use. The "Recent apps" shortcuts are for example "Cycle through recent apps". [CHAR LIMIT=NONE] --> <string name="shortcutHelper_category_recent_apps">Recent apps</string> <!-- Title of the keyboard shortcut helper category "Split screen". The helper is a component that shows the user which keyboard shortcuts they can use. The "Split screen" shortcuts are for example "Move current app to left split". [CHAR LIMIT=NONE] --> <string name="shortcutHelper_category_split_screen">Split screen</string> <!-- Title of the keyboard shortcut helper category "Input". The helper is a component that shows the user which keyboard shortcuts they can use. The "Input" shortcuts are the ones provided by the keyboard. Examples are "Access emoji" or "Switch to next language" Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt +3 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package com.android.systemui.keyboard.shortcut import android.app.Activity import com.android.systemui.CoreStartable import com.android.systemui.Flags.keyboardShortcutHelperRewrite import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperRepository import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperStateRepository import com.android.systemui.keyboard.shortcut.ui.ShortcutHelperActivityStarter import com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity import dagger.Binds Loading Loading @@ -52,8 +52,8 @@ interface ShortcutHelperModule { @Provides @IntoMap @ClassKey(ShortcutHelperRepository::class) fun repo(implLazy: Lazy<ShortcutHelperRepository>): CoreStartable { @ClassKey(ShortcutHelperStateRepository::class) fun repo(implLazy: Lazy<ShortcutHelperStateRepository>): CoreStartable { return if (keyboardShortcutHelperRewrite()) { implLazy.get() } else { Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperCategoriesRepository.kt 0 → 100644 +38 −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.keyboard.shortcut.data.repository import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyboard.shortcut.data.source.MultitaskingShortcutsSource import com.android.systemui.keyboard.shortcut.data.source.SystemShortcutsSource import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategory import javax.inject.Inject @SysUISingleton class ShortcutHelperCategoriesRepository @Inject constructor( private val systemShortcutsSource: SystemShortcutsSource, private val multitaskingShortcutsSource: MultitaskingShortcutsSource, ) { fun systemShortcutsCategory(): ShortcutCategory = systemShortcutsSource.systemShortcutsCategory() fun multitaskingShortcutsCategory(): ShortcutCategory = multitaskingShortcutsSource.multitaskingShortcutCategory() } packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepository.kt→packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperStateRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @SysUISingleton class ShortcutHelperRepository class ShortcutHelperStateRepository @Inject constructor( private val commandQueue: CommandQueue, Loading packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/MultitaskingShortcutsSource.kt +18 −3 Original line number Diff line number Diff line Loading @@ -25,13 +25,28 @@ import android.view.KeyEvent.META_ALT_ON import android.view.KeyEvent.META_CTRL_ON import android.view.KeyEvent.META_META_ON import android.view.KeyEvent.META_SHIFT_ON import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType.MULTI_TASKING import com.android.systemui.keyboard.shortcut.shared.model.shortcut import com.android.systemui.keyboard.shortcut.shared.model.shortcutCategory import com.android.systemui.res.R import javax.inject.Inject class MultitaskingShortcutsSource @Inject constructor(private val resources: Resources) { class MultitaskingShortcutsSource @Inject constructor(@Main private val resources: Resources) { fun splitScreenShortcuts() = fun multitaskingShortcutCategory() = shortcutCategory(MULTI_TASKING) { subCategory( resources.getString(R.string.shortcutHelper_category_recent_apps), recentsShortcuts() ) subCategory( resources.getString(R.string.shortcutHelper_category_split_screen), splitScreenShortcuts() ) } private fun splitScreenShortcuts() = listOf( // Enter Split screen with current app to RHS: // - Meta + Ctrl + Right arrow Loading Loading @@ -60,7 +75,7 @@ class MultitaskingShortcutsSource @Inject constructor(private val resources: Res }, ) fun recentsShortcuts() = private fun recentsShortcuts() = listOf( // Cycle through recent apps (forward): // - Alt + Tab Loading Loading
packages/SystemUI/res/values/strings.xml +16 −0 Original line number Diff line number Diff line Loading @@ -3543,10 +3543,26 @@ shows the user which keyboard shortcuts they can use. The "System" shortcuts are for example "Take a screenshot" or "Go back". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system">System</string> <!-- Title of the keyboard shortcut helper category "System controls". The helper is a component that shows the user which keyboard shortcuts they can use. The "System controls" shortcuts are for example "Go to home screen" or "App apps search". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system_controls">System controls</string> <!-- Title of the keyboard shortcut helper category "System apps". The helper is a component that shows the user which keyboard shortcuts they can use. The "System apps" shortcuts are for example "Settings" or "Take a note". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_system_apps">System apps</string> <!-- Title of the keyboard shortcut helper category "Multitasking". The helper is a component that shows the user which keyboard shortcuts they can use. The "Multitasking" shortcuts are for example "Enter split screen". [CHAR LIMIT=NONE] --> <string name="shortcut_helper_category_multitasking">Multitasking</string> <!-- Title of the keyboard shortcut helper category "Recent apps". The helper is a component that shows the user which keyboard shortcuts they can use. The "Recent apps" shortcuts are for example "Cycle through recent apps". [CHAR LIMIT=NONE] --> <string name="shortcutHelper_category_recent_apps">Recent apps</string> <!-- Title of the keyboard shortcut helper category "Split screen". The helper is a component that shows the user which keyboard shortcuts they can use. The "Split screen" shortcuts are for example "Move current app to left split". [CHAR LIMIT=NONE] --> <string name="shortcutHelper_category_split_screen">Split screen</string> <!-- Title of the keyboard shortcut helper category "Input". The helper is a component that shows the user which keyboard shortcuts they can use. The "Input" shortcuts are the ones provided by the keyboard. Examples are "Access emoji" or "Switch to next language" Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt +3 −3 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ package com.android.systemui.keyboard.shortcut import android.app.Activity import com.android.systemui.CoreStartable import com.android.systemui.Flags.keyboardShortcutHelperRewrite import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperRepository import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperStateRepository import com.android.systemui.keyboard.shortcut.ui.ShortcutHelperActivityStarter import com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity import dagger.Binds Loading Loading @@ -52,8 +52,8 @@ interface ShortcutHelperModule { @Provides @IntoMap @ClassKey(ShortcutHelperRepository::class) fun repo(implLazy: Lazy<ShortcutHelperRepository>): CoreStartable { @ClassKey(ShortcutHelperStateRepository::class) fun repo(implLazy: Lazy<ShortcutHelperStateRepository>): CoreStartable { return if (keyboardShortcutHelperRewrite()) { implLazy.get() } else { Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperCategoriesRepository.kt 0 → 100644 +38 −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.keyboard.shortcut.data.repository import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyboard.shortcut.data.source.MultitaskingShortcutsSource import com.android.systemui.keyboard.shortcut.data.source.SystemShortcutsSource import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategory import javax.inject.Inject @SysUISingleton class ShortcutHelperCategoriesRepository @Inject constructor( private val systemShortcutsSource: SystemShortcutsSource, private val multitaskingShortcutsSource: MultitaskingShortcutsSource, ) { fun systemShortcutsCategory(): ShortcutCategory = systemShortcutsSource.systemShortcutsCategory() fun multitaskingShortcutsCategory(): ShortcutCategory = multitaskingShortcutsSource.multitaskingShortcutCategory() }
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepository.kt→packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperStateRepository.kt +1 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext @SysUISingleton class ShortcutHelperRepository class ShortcutHelperStateRepository @Inject constructor( private val commandQueue: CommandQueue, Loading
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/source/MultitaskingShortcutsSource.kt +18 −3 Original line number Diff line number Diff line Loading @@ -25,13 +25,28 @@ import android.view.KeyEvent.META_ALT_ON import android.view.KeyEvent.META_CTRL_ON import android.view.KeyEvent.META_META_ON import android.view.KeyEvent.META_SHIFT_ON import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.keyboard.shortcut.shared.model.ShortcutCategoryType.MULTI_TASKING import com.android.systemui.keyboard.shortcut.shared.model.shortcut import com.android.systemui.keyboard.shortcut.shared.model.shortcutCategory import com.android.systemui.res.R import javax.inject.Inject class MultitaskingShortcutsSource @Inject constructor(private val resources: Resources) { class MultitaskingShortcutsSource @Inject constructor(@Main private val resources: Resources) { fun splitScreenShortcuts() = fun multitaskingShortcutCategory() = shortcutCategory(MULTI_TASKING) { subCategory( resources.getString(R.string.shortcutHelper_category_recent_apps), recentsShortcuts() ) subCategory( resources.getString(R.string.shortcutHelper_category_split_screen), splitScreenShortcuts() ) } private fun splitScreenShortcuts() = listOf( // Enter Split screen with current app to RHS: // - Meta + Ctrl + Right arrow Loading Loading @@ -60,7 +75,7 @@ class MultitaskingShortcutsSource @Inject constructor(private val resources: Res }, ) fun recentsShortcuts() = private fun recentsShortcuts() = listOf( // Cycle through recent apps (forward): // - Alt + Tab Loading