From 6a286e3711f68c8043f327300bc800c0a011b4cd Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Mon, 22 Jan 2024 20:21:59 +0100 Subject: [PATCH] Use 'Main UI' in code Except for key that would change existing widgets/settings. Signed-off-by: mueller-ma --- .../openhab/habdroid/model/ServerProperties.kt | 4 ++-- .../org/openhab/habdroid/model/WebViewUi.kt | 8 ++++---- .../org/openhab/habdroid/ui/MainActivity.kt | 16 ++++++++-------- ...ViewFragment.kt => MainUiWebViewFragment.kt} | 10 +++++----- .../java/org/openhab/habdroid/util/PrefKeys.kt | 2 +- mobile/src/main/res/menu/left_drawer.xml | 4 ++-- ...rtcut_oh3_ui.xml => ic_shortcut_main_ui.xml} | 0 ...rtcut_oh3_ui.png => ic_shortcut_main_ui.png} | Bin ...rtcut_oh3_ui.png => ic_shortcut_main_ui.png} | Bin ...rtcut_oh3_ui.png => ic_shortcut_main_ui.png} | Bin ...rtcut_oh3_ui.png => ic_shortcut_main_ui.png} | Bin ...rtcut_oh3_ui.png => ic_shortcut_main_ui.png} | Bin mobile/src/main/res/values-bg/strings.xml | 2 +- mobile/src/main/res/values-de/strings.xml | 4 ++-- mobile/src/main/res/values-es-rUS/strings.xml | 2 +- mobile/src/main/res/values-es/strings.xml | 2 +- mobile/src/main/res/values-hu/strings.xml | 4 ++-- mobile/src/main/res/values-it/strings.xml | 4 ++-- mobile/src/main/res/values-iw/strings.xml | 4 ++-- mobile/src/main/res/values-nb/strings.xml | 4 ++-- mobile/src/main/res/values-ru/strings.xml | 4 ++-- mobile/src/main/res/values-zh-rCN/strings.xml | 4 ++-- mobile/src/main/res/values/arrays.xml | 2 +- mobile/src/main/res/values/strings.xml | 4 ++-- .../main/res/xml/preferences_drawer_entries.xml | 2 +- 25 files changed, 43 insertions(+), 43 deletions(-) rename mobile/src/main/java/org/openhab/habdroid/ui/activity/{Oh3UiWebViewFragment.kt => MainUiWebViewFragment.kt} (73%) rename mobile/src/main/res/mipmap-anydpi-v26/{ic_shortcut_oh3_ui.xml => ic_shortcut_main_ui.xml} (100%) rename mobile/src/main/res/mipmap-hdpi/{ic_shortcut_oh3_ui.png => ic_shortcut_main_ui.png} (100%) rename mobile/src/main/res/mipmap-mdpi/{ic_shortcut_oh3_ui.png => ic_shortcut_main_ui.png} (100%) rename mobile/src/main/res/mipmap-xhdpi/{ic_shortcut_oh3_ui.png => ic_shortcut_main_ui.png} (100%) rename mobile/src/main/res/mipmap-xxhdpi/{ic_shortcut_oh3_ui.png => ic_shortcut_main_ui.png} (100%) rename mobile/src/main/res/mipmap-xxxhdpi/{ic_shortcut_oh3_ui.png => ic_shortcut_main_ui.png} (100%) diff --git a/mobile/src/main/java/org/openhab/habdroid/model/ServerProperties.kt b/mobile/src/main/java/org/openhab/habdroid/model/ServerProperties.kt index 7258494800..cbe1080d42 100644 --- a/mobile/src/main/java/org/openhab/habdroid/model/ServerProperties.kt +++ b/mobile/src/main/java/org/openhab/habdroid/model/ServerProperties.kt @@ -57,7 +57,7 @@ data class ServerProperties(val flags: Int, val sitemaps: List) : Parce const val SERVER_FLAG_HABPANEL_INSTALLED = 1 shl 4 const val SERVER_FLAG_SITEMAP_HAS_INVISIBLE_WIDGETS = 1 shl 5 const val SERVER_FLAG_SUPPORTS_ANY_FORMAT_ICON = 1 shl 6 - const val SERVER_FLAG_OH3_UI = 1 shl 7 + const val SERVER_FLAG_MAIN_UI = 1 shl 7 const val SERVER_FLAG_TRANSPARENT_CHARTS = 1 shl 8 private sealed interface FlagsResult @@ -101,7 +101,7 @@ data class ServerProperties(val flags: Int, val sitemaps: List) : Parce flags = flags or SERVER_FLAG_SUPPORTS_ANY_FORMAT_ICON } if (version >= 4) { - flags = flags or SERVER_FLAG_OH3_UI + flags = flags or SERVER_FLAG_MAIN_UI } if (version >= 5) { flags = flags or SERVER_FLAG_TRANSPARENT_CHARTS diff --git a/mobile/src/main/java/org/openhab/habdroid/model/WebViewUi.kt b/mobile/src/main/java/org/openhab/habdroid/model/WebViewUi.kt index 7320e83fde..88201a57d9 100644 --- a/mobile/src/main/java/org/openhab/habdroid/model/WebViewUi.kt +++ b/mobile/src/main/java/org/openhab/habdroid/model/WebViewUi.kt @@ -16,7 +16,7 @@ package org.openhab.habdroid.model import org.openhab.habdroid.ui.activity.AbstractWebViewFragment import org.openhab.habdroid.ui.activity.FrontailWebViewFragment import org.openhab.habdroid.ui.activity.HabpanelWebViewFragment -import org.openhab.habdroid.ui.activity.Oh3UiWebViewFragment +import org.openhab.habdroid.ui.activity.MainUiWebViewFragment data class WebViewUi( val serverFlag: Int, @@ -28,9 +28,9 @@ data class WebViewUi( HabpanelWebViewFragment::class.java ) - val OH3_UI = WebViewUi( - ServerProperties.SERVER_FLAG_OH3_UI, - Oh3UiWebViewFragment::class.java + val MAIN_UI = WebViewUi( + ServerProperties.SERVER_FLAG_MAIN_UI, + MainUiWebViewFragment::class.java ) val FRONTAIL = WebViewUi( diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt b/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt index 1864572b42..44b52ec768 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt @@ -813,12 +813,12 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener { val notificationId = intent.getStringExtra(EXTRA_PERSISTED_NOTIFICATION_ID).orEmpty() executeActionIfPossible(PendingAction.OpenNotification(notificationId, true)) } - ACTION_HABPANEL_SELECTED, ACTION_OH3_UI_SELECTED, ACTION_FRONTAIL_SELECTED -> { + ACTION_HABPANEL_SELECTED, ACTION_MAIN_UI_SELECTED, ACTION_FRONTAIL_SELECTED -> { val serverId = intent.getIntExtra(EXTRA_SERVER_ID, prefs.getActiveServerId()) val ui = when (intent.action) { ACTION_HABPANEL_SELECTED -> WebViewUi.HABPANEL ACTION_FRONTAIL_SELECTED -> WebViewUi.FRONTAIL - else -> WebViewUi.OH3_UI + else -> WebViewUi.MAIN_UI } val subpage = intent.getStringExtra(EXTRA_SUBPAGE) executeOrStoreAction(PendingAction.OpenWebViewUi(ui, serverId, subpage)) @@ -901,8 +901,8 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener { openWebViewUi(WebViewUi.HABPANEL, false, null) handled = true } - R.id.oh3_ui -> { - openWebViewUi(WebViewUi.OH3_UI, false, null) + R.id.main_ui -> { + openWebViewUi(WebViewUi.MAIN_UI, false, null) handled = true } R.id.frontail -> { @@ -1054,9 +1054,9 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener { prefs.getBoolean(PrefKeys.DRAWER_ENTRY_HABPANEL, true) manageHabPanelShortcut(serverProperties?.hasWebViewUiInstalled(WebViewUi.HABPANEL) == true) - val oh3UiItem = drawerMenu.findItem(R.id.oh3_ui) - oh3UiItem.isVisible = serverProperties?.hasWebViewUiInstalled(WebViewUi.OH3_UI) == true && - prefs.getBoolean(PrefKeys.DRAWER_ENTRY_OH3_UI, true) + val mainUiItem = drawerMenu.findItem(R.id.main_ui) + mainUiItem.isVisible = serverProperties?.hasWebViewUiInstalled(WebViewUi.MAIN_UI) == true && + prefs.getBoolean(PrefKeys.DRAWER_ENTRY_MAIN_UI, true) val frontailItem = drawerMenu.findItem(R.id.frontail) frontailItem.isVisible = serverProperties != null && @@ -1499,7 +1499,7 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener { companion object { const val ACTION_NOTIFICATION_SELECTED = "org.openhab.habdroid.action.NOTIFICATION_SELECTED" const val ACTION_HABPANEL_SELECTED = "org.openhab.habdroid.action.HABPANEL_SELECTED" - const val ACTION_OH3_UI_SELECTED = "org.openhab.habdroid.action.OH3_UI_SELECTED" + const val ACTION_MAIN_UI_SELECTED = "org.openhab.habdroid.action.OH3_UI_SELECTED" const val ACTION_FRONTAIL_SELECTED = "org.openhab.habdroid.action.FRONTAIL" const val ACTION_VOICE_RECOGNITION_SELECTED = "org.openhab.habdroid.action.VOICE_SELECTED" const val ACTION_SITEMAP_SELECTED = "org.openhab.habdroid.action.SITEMAP_SELECTED" diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/activity/Oh3UiWebViewFragment.kt b/mobile/src/main/java/org/openhab/habdroid/ui/activity/MainUiWebViewFragment.kt similarity index 73% rename from mobile/src/main/java/org/openhab/habdroid/ui/activity/Oh3UiWebViewFragment.kt rename to mobile/src/main/java/org/openhab/habdroid/ui/activity/MainUiWebViewFragment.kt index 36e7fb250d..1c2438bf0d 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/activity/Oh3UiWebViewFragment.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/activity/MainUiWebViewFragment.kt @@ -17,14 +17,14 @@ import okhttp3.HttpUrl import org.openhab.habdroid.R import org.openhab.habdroid.ui.MainActivity -class Oh3UiWebViewFragment : AbstractWebViewFragment() { - override val titleRes = R.string.mainmenu_openhab_oh3_ui - override val errorMessageRes = R.string.oh3_ui_error +class MainUiWebViewFragment : AbstractWebViewFragment() { + override val titleRes = R.string.mainmenu_openhab_main_ui + override val errorMessageRes = R.string.main_ui_error override val urlToLoad = "/" override val pathForError = "/" override val lockDrawer = true - override val shortcutIcon = R.mipmap.ic_shortcut_oh3_ui - override val shortcutAction = MainActivity.ACTION_OH3_UI_SELECTED + override val shortcutIcon = R.mipmap.ic_shortcut_main_ui + override val shortcutAction = MainActivity.ACTION_MAIN_UI_SELECTED override fun modifyUrl(orig: HttpUrl): HttpUrl { if (orig.host == "myopenhab.org") { diff --git a/mobile/src/main/java/org/openhab/habdroid/util/PrefKeys.kt b/mobile/src/main/java/org/openhab/habdroid/util/PrefKeys.kt index 26165084ff..1362f3fa37 100644 --- a/mobile/src/main/java/org/openhab/habdroid/util/PrefKeys.kt +++ b/mobile/src/main/java/org/openhab/habdroid/util/PrefKeys.kt @@ -83,7 +83,7 @@ object PrefKeys { const val DEBUG_MESSAGES = "default_openhab_debug_messages" const val LOG = "default_openhab_log" - const val DRAWER_ENTRY_OH3_UI = "show_oh3_ui" + const val DRAWER_ENTRY_MAIN_UI = "show_oh3_ui" const val DRAWER_ENTRY_HABPANEL = "show_habpanel" const val DRAWER_ENTRY_NFC = "show_nfc" const val DRAWER_ENTRY_FRONTAIL = "show_frontail" diff --git a/mobile/src/main/res/menu/left_drawer.xml b/mobile/src/main/res/menu/left_drawer.xml index 382fa89bde..e625ec2bae 100644 --- a/mobile/src/main/res/menu/left_drawer.xml +++ b/mobile/src/main/res/menu/left_drawer.xml @@ -17,9 +17,9 @@ android:id="@+id/options" android:checkableBehavior="none"> Известия Грешка при зареждане на HABPanel - Грешка при зареждане на Main UI + Грешка при зареждане на Main UI Избери сайткарта по подразбиране Изчисти кеша на изображенията diff --git a/mobile/src/main/res/values-de/strings.xml b/mobile/src/main/res/values-de/strings.xml index 0bbb5d5183..661dd5d1a4 100644 --- a/mobile/src/main/res/values-de/strings.xml +++ b/mobile/src/main/res/values-de/strings.xml @@ -14,13 +14,13 @@ Sitemaps Einstellungen HABPanel - Main UI + Main UI Frontail %1$s (%2$s) Benachrichtigungen Beim Laden von HABPanel ist ein Fehler aufgetreten - Beim Laden der Main UI ist ein Fehler aufgetreten + Beim Laden der Main UI ist ein Fehler aufgetreten Beim Laden von Frontail ist ein Fehler aufgetreten. Bitte beachten Sie, dass Frontail nicht über openHAB Cloud verfügbar ist. Standard-Sitemap auswählen Bilder-Cache leeren diff --git a/mobile/src/main/res/values-es-rUS/strings.xml b/mobile/src/main/res/values-es-rUS/strings.xml index 66576161d7..3cad3cb3f8 100644 --- a/mobile/src/main/res/values-es-rUS/strings.xml +++ b/mobile/src/main/res/values-es-rUS/strings.xml @@ -14,7 +14,7 @@ Sitemaps Configuración HABPanel - Main UI + Main UI Frontail %1$s (%2$s) diff --git a/mobile/src/main/res/values-es/strings.xml b/mobile/src/main/res/values-es/strings.xml index 66576161d7..3cad3cb3f8 100644 --- a/mobile/src/main/res/values-es/strings.xml +++ b/mobile/src/main/res/values-es/strings.xml @@ -14,7 +14,7 @@ Sitemaps Configuración HABPanel - Main UI + Main UI Frontail %1$s (%2$s) diff --git a/mobile/src/main/res/values-hu/strings.xml b/mobile/src/main/res/values-hu/strings.xml index 639c3b0184..acf12d315e 100644 --- a/mobile/src/main/res/values-hu/strings.xml +++ b/mobile/src/main/res/values-hu/strings.xml @@ -14,13 +14,13 @@ Felületek Beállítások HABPanel - Főképernyő + Főképernyő Frontail %1$s (%2$s) Értesítések Hiba történt a HABPanel betöltése során - Hiba lépett fel az főképernyő (Main UI) beöltésekor + Hiba lépett fel az főképernyő (Main UI) beöltésekor Hiba történt a Frontail betöltése közben. Vegye figyelembe, hogy openHAB Cloud-n keresztül nem elérhető. Válassza ki az alapértelmezett felületet Gyorsítótári képek törlése diff --git a/mobile/src/main/res/values-it/strings.xml b/mobile/src/main/res/values-it/strings.xml index a31c720fe4..bf2b067c68 100644 --- a/mobile/src/main/res/values-it/strings.xml +++ b/mobile/src/main/res/values-it/strings.xml @@ -14,13 +14,13 @@ Sitemaps Impostazioni HABPanel - Main UI + Main UI Frontail %1$s (%2$s) Notifiche Si è verificato un errore caricando HABPanel - Si è verificato un errore durante il caricamento dell\'interfaccia utente principale Main UI + Si è verificato un errore durante il caricamento dell\'interfaccia utente principale Main UI Si è verificato un errore durante il caricamento di Frontail. Nota che non è disponibile tramite openHAB Cloud. Seleziona Sitemap predefinito Pulisci cache immagini diff --git a/mobile/src/main/res/values-iw/strings.xml b/mobile/src/main/res/values-iw/strings.xml index 7c17127d76..590a86b1d0 100644 --- a/mobile/src/main/res/values-iw/strings.xml +++ b/mobile/src/main/res/values-iw/strings.xml @@ -14,13 +14,13 @@ תצורות מערכת הגדרות HABPanel - ממשק משתמש ראשי + ממשק משתמש ראשי Frontail %1$s (%2$s) התראות אירעה שגיאה בעת טעינת HABPanel - אירעה שגיאה בעת טעינת ממשק המשתמש הראשי + אירעה שגיאה בעת טעינת ממשק המשתמש הראשי אירעה שגיאה בעת טעינת Frontail. שים לב שהוא אינו זמין דרך openHAB Cloud. בחר את ברירת המחדל של תצורת המערכת נקה מטמון תמונות diff --git a/mobile/src/main/res/values-nb/strings.xml b/mobile/src/main/res/values-nb/strings.xml index d5fdc692e2..e9ca3ae0fe 100644 --- a/mobile/src/main/res/values-nb/strings.xml +++ b/mobile/src/main/res/values-nb/strings.xml @@ -14,13 +14,13 @@ Sitemaps Innstillinger HABPanel - Main UI + Main UI Frontail %1$s (%2$s) Varslinger Det oppstod en feil under innlasting av HABPanel - En feil oppstod under lasting av Main UI + En feil oppstod under lasting av Main UI Det oppstod en feil under lasting av Frontail. Vær oppmerksom på at det ikke er tilgjengelig via openHAB Cloud. Velg standard Sitemap Tøm bildebuffer diff --git a/mobile/src/main/res/values-ru/strings.xml b/mobile/src/main/res/values-ru/strings.xml index 686d836d36..e2a72b366f 100644 --- a/mobile/src/main/res/values-ru/strings.xml +++ b/mobile/src/main/res/values-ru/strings.xml @@ -14,13 +14,13 @@ Sitemaps Настройки HABPanel - Main UI + Main UI Frontail %1$s (%2$s) Уведомления Произошла ошибка при загрузке HABPanel - Произошла ошибка при загрузке Main UI + Произошла ошибка при загрузке Main UI Произошла ошибка при загрузке Frontail. Пожалуйста, обратите внимание, что она недоступна через облако openHAB. Выбрать Sitemap по умолчанию Очистить кэш изображений diff --git a/mobile/src/main/res/values-zh-rCN/strings.xml b/mobile/src/main/res/values-zh-rCN/strings.xml index 2a9e51e88a..9e5fc509b5 100644 --- a/mobile/src/main/res/values-zh-rCN/strings.xml +++ b/mobile/src/main/res/values-zh-rCN/strings.xml @@ -14,13 +14,13 @@ 系统布局 设置 HAB 面板 - 主界面 + 主界面 Frontail %1$s (%2$s) 通知 载入 HAB 面板时出错 - 加载主界面时发生错误 + 加载主界面时发生错误 加载正面时发生错误。请注意它无法通过 openHAB云访问。 选择默认系统布局 清除图像缓存 diff --git a/mobile/src/main/res/values/arrays.xml b/mobile/src/main/res/values/arrays.xml index a0871c6ebb..17133c6d6f 100644 --- a/mobile/src/main/res/values/arrays.xml +++ b/mobile/src/main/res/values/arrays.xml @@ -192,7 +192,7 @@ @string/mainmenu_openhab_sitemaps @string/mainmenu_openhab_habpanel - @string/mainmenu_openhab_oh3_ui + @string/mainmenu_openhab_main_ui @string/mainmenu_openhab_frontail diff --git a/mobile/src/main/res/values/strings.xml b/mobile/src/main/res/values/strings.xml index 2d87be2fe9..a158ad1ff1 100644 --- a/mobile/src/main/res/values/strings.xml +++ b/mobile/src/main/res/values/strings.xml @@ -18,13 +18,13 @@ Sitemaps Settings HABPanel - Main UI + Main UI Frontail %1$s (%2$s) Notifications An error occurred while loading HABPanel - An error occurred while loading Main UI + An error occurred while loading Main UI An error occurred while loading Frontail. Please note that it\'s not available via openHAB Cloud. Select default Sitemap Clear images cache diff --git a/mobile/src/main/res/xml/preferences_drawer_entries.xml b/mobile/src/main/res/xml/preferences_drawer_entries.xml index 0674e4cb14..dcbe47658a 100644 --- a/mobile/src/main/res/xml/preferences_drawer_entries.xml +++ b/mobile/src/main/res/xml/preferences_drawer_entries.xml @@ -12,7 +12,7 @@ android:defaultValue="true" android:key="show_oh3_ui" android:icon="@drawable/ic_outline_looks_3_grey_24dp" - android:title="@string/mainmenu_openhab_oh3_ui" + android:title="@string/mainmenu_openhab_main_ui" android:widgetLayout="@layout/preference_material_switch" />