From 5c6af3c3e14c6091b441bcb2db2e4600ed41751d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 19 Aug 2023 09:29:20 +0200 Subject: [PATCH] SetupWizard: toolbar --- app/src/main/AndroidManifest.xml | 2 +- .../activities/PreferencesActivity.kt | 1 - .../src/main/AndroidManifest.xml | 1 - .../DaggerAppCompatActivityWithResult.kt | 1 - .../configuration/setupwizard/SWDefinition.kt | 2 +- .../setupwizard/SetupWizardActivity.kt | 28 +++++++++++++---- .../src/main/res/drawable/ic_exit_to_app.xml | 12 -------- .../main/res/layout/activity_setupwizard.xml | 30 ------------------- .../src/main/res/values/strings.xml | 2 +- 9 files changed, 25 insertions(+), 54 deletions(-) delete mode 100644 plugins/configuration/src/main/res/drawable/ic_exit_to_app.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1d5b47af92..2ae2fd0fe3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -58,7 +58,7 @@ + android:theme="@style/AppTheme.NoActionBar"> diff --git a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt index a6493ef61a..679824f702 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/PreferencesActivity.kt @@ -22,7 +22,6 @@ class PreferencesActivity : DaggerAppCompatActivityWithResult(), PreferenceFragm override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setTheme(info.nightscout.core.ui.R.style.AppTheme) binding = ActivityPreferencesBinding.inflate(layoutInflater) setContentView(binding.root) diff --git a/plugins/configuration/src/main/AndroidManifest.xml b/plugins/configuration/src/main/AndroidManifest.xml index 700ebdafae..207b6338d5 100644 --- a/plugins/configuration/src/main/AndroidManifest.xml +++ b/plugins/configuration/src/main/AndroidManifest.xml @@ -8,7 +8,6 @@ android:name=".setupwizard.SetupWizardActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="false" - android:label="@string/title_activity_setup_wizard" android:theme="@style/AppTheme" /> { + sp.putBoolean(R.string.key_setupwizard_processed, true) + OKDialog.showConfirmation(this@SetupWizardActivity, rh.gs(R.string.exitwizard)) { finish() } + true + } + + else -> false + } + }) } override fun onPause() { @@ -141,12 +163,6 @@ class SetupWizardActivity : DaggerAppCompatActivityWithResult() { } } - @Suppress("UNUSED_PARAMETER") - fun exitPressed(view: View?) { - sp.putBoolean(R.string.key_setupwizard_processed, true) - OKDialog.showConfirmation(this, rh.gs(R.string.exitwizard)) { finish() } - } - @Suppress("UNUSED_PARAMETER") fun showNextPage(view: View?) { finish() diff --git a/plugins/configuration/src/main/res/drawable/ic_exit_to_app.xml b/plugins/configuration/src/main/res/drawable/ic_exit_to_app.xml deleted file mode 100644 index ce1caf7dfe..0000000000 --- a/plugins/configuration/src/main/res/drawable/ic_exit_to_app.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/plugins/configuration/src/main/res/layout/activity_setupwizard.xml b/plugins/configuration/src/main/res/layout/activity_setupwizard.xml index 0941bd9d72..0cb6c41186 100644 --- a/plugins/configuration/src/main/res/layout/activity_setupwizard.xml +++ b/plugins/configuration/src/main/res/layout/activity_setupwizard.xml @@ -1,41 +1,11 @@ - - - - - - - Units Select units you want to display values in - SetupWizardActivity Next Prev Setup Wizard FINISH + Welcome Welcome to setup wizard. It will guide you through the setup process\n End User License Agreement MUST NOT BE USED TO MAKE MEDICAL DECISIONS. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.