diff --git a/app/src/main/java/de/jrpie/android/launcher/actions/LauncherAction.kt b/app/src/main/java/de/jrpie/android/launcher/actions/LauncherAction.kt index a3acbb7..68dbebd 100644 --- a/app/src/main/java/de/jrpie/android/launcher/actions/LauncherAction.kt +++ b/app/src/main/java/de/jrpie/android/launcher/actions/LauncherAction.kt @@ -64,6 +64,12 @@ enum class LauncherAction( R.drawable.baseline_notifications_24, ::expandNotificationsPanel ), + EXPAND_SETTINGS_PANEL( + "launcher:expandSettingsPanel", + R.string.list_other_expand_settings_panel, + R.drawable.baseline_settings_applications_24, + ::expandSettingsPanel + ), NOP("launcher:nop", R.string.list_other_nop, R.drawable.baseline_not_interested_24, {}); override fun invoke(context: Context, rect: Rect?): Boolean { @@ -169,7 +175,24 @@ private fun expandNotificationsPanel(context: Context) { } catch (e: Exception) { Toast.makeText( context, - context.getString(R.string.alert_cant_expand_notifications_panel), + context.getString(R.string.alert_cant_expand_status_bar_panel), + Toast.LENGTH_LONG + ).show() + } +} + +private fun expandSettingsPanel(context: Context) { + /* https://stackoverflow.com/a/31898506 */ + try { + @Suppress("SpellCheckingInspection") + val statusBarService: Any? = context.getSystemService("statusbar") + val statusBarManager = Class.forName("android.app.StatusBarManager") + val showStatusBar = statusBarManager.getMethod("expandSettingsPanel") + showStatusBar.invoke(statusBarService) + } catch (e: Exception) { + Toast.makeText( + context, + context.getString(R.string.alert_cant_expand_status_bar_panel), Toast.LENGTH_LONG ).show() } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 88a7580..45effcd 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -138,6 +138,7 @@ Einstellungen Mehr Optionen Benachrichtigungen - Fehler: Die Funktion \"Benachrichtigungen\" wird von deinem Gerät leider nicht unterstützt. + Fehler: Diese Funktion wird von deinem Gerät leider nicht unterstützt. Sekunden anzeigen - \ No newline at end of file + Schnelleinstellungen + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 8ac5796..8032c7a 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -133,7 +133,7 @@ Configurações Mais opções Remover dos favoritos - Erro: Não foi possível expandir a barra de status. + Erro: Não foi possível expandir a barra de status. \nEssa ação usa uma funcionalidade que não faz parte da API do Android publicada. Infelizmente, ela não vai funcionar no seu dispositivo. Fundo (lista de apps e configurações) Fonte diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index bc9b212..26531bc 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -110,6 +110,6 @@ 旋转屏幕 应用 展开通知面板 - 错误:无法打开通知栏。 + 错误:无法打开通知栏。 \n这个动作使用的功能并非现有的 Android API的一部分。不幸的是,它似乎不适用于您的设备。 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 348a4b6..c17d4e3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -204,7 +204,8 @@ Settings More options - Error: Can\'t expand status bar.\nThis action is using functionality that is not part of the published Android API. Unfortunately, it does not seem to work on your device. + Error: Can\'t expand status bar.\nThis action is using functionality that is not part of the published Android API. Unfortunately, it does not seem to work on your device. App hidden. You can make it visible again in settings. Undo + Quick Settings