From b606df5e447f5686bce6e45d0360a4d9efa25757 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 3 Jan 2024 20:01:14 -0500 Subject: [PATCH] More MD3 theming rework --- .../im/angry/openeuicc/ui/MainActivity.kt | 2 ++ .../openeuicc/ui/NotificationsActivity.kt | 1 + .../im/angry/openeuicc/ui/SettingsActivity.kt | 5 +++- .../src/main/res/layout/activity_main.xml | 14 ++++++++--- .../res/layout/activity_notifications.xml | 23 ++++++++++++++---- .../src/main/res/layout/activity_settings.xml | 24 +++++++++++++++++++ .../res/layout/fragment_profile_download.xml | 2 -- .../res/layout/fragment_profile_rename.xml | 2 -- app-common/src/main/res/values/themes.xml | 9 ++++--- 9 files changed, 64 insertions(+), 18 deletions(-) create mode 100644 app-common/src/main/res/layout/activity_settings.xml diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt index e1a5ccf..76a5229 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt @@ -39,6 +39,8 @@ open class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) + setSupportActionBar(findViewById(R.id.toolbar)) + noEuiccPlaceholder = findViewById(R.id.no_euicc_placeholder) tm = openEuiccApplication.telephonyManager diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt index 6e9fcc9..68d666a 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt @@ -38,6 +38,7 @@ class NotificationsActivity: AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_notifications) + setSupportActionBar(findViewById(R.id.toolbar)) supportActionBar!!.setDisplayHomeAsUpEnabled(true) euiccChannel = (application as OpenEuiccApplication).euiccChannelManager diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsActivity.kt index f23fffd..f5bb4d4 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsActivity.kt @@ -3,13 +3,16 @@ package im.angry.openeuicc.ui import android.os.Bundle import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity +import im.angry.openeuicc.common.R class SettingsActivity: AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + setContentView(R.layout.activity_settings) + setSupportActionBar(findViewById(R.id.toolbar)) supportActionBar!!.setDisplayHomeAsUpEnabled(true) supportFragmentManager.beginTransaction() - .replace(android.R.id.content, SettingsFragment()) + .replace(R.id.settings_container, SettingsFragment()) .commit() } diff --git a/app-common/src/main/res/layout/activity_main.xml b/app-common/src/main/res/layout/activity_main.xml index 861e481..74b7799 100644 --- a/app-common/src/main/res/layout/activity_main.xml +++ b/app-common/src/main/res/layout/activity_main.xml @@ -6,14 +6,22 @@ android:layout_height="match_parent" tools:context=".ui.MainActivity"> + + + app:layout_constraintTop_toBottomOf="@id/toolbar"> - + android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintTop_toBottomOf="@id/toolbar" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> - \ No newline at end of file + \ No newline at end of file diff --git a/app-common/src/main/res/layout/activity_settings.xml b/app-common/src/main/res/layout/activity_settings.xml new file mode 100644 index 0000000..8a0bd5f --- /dev/null +++ b/app-common/src/main/res/layout/activity_settings.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/app-common/src/main/res/layout/fragment_profile_download.xml b/app-common/src/main/res/layout/fragment_profile_download.xml index 394e698..14b3c3f 100644 --- a/app-common/src/main/res/layout/fragment_profile_download.xml +++ b/app-common/src/main/res/layout/fragment_profile_download.xml @@ -8,8 +8,6 @@ android:id="@+id/toolbar" android:layout_width="0dp" android:layout_height="wrap_content" - android:theme="@style/Theme.OpenEUICC" - android:elevation="4dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintWidth_percent="1" diff --git a/app-common/src/main/res/layout/fragment_profile_rename.xml b/app-common/src/main/res/layout/fragment_profile_rename.xml index 2feec78..630063b 100644 --- a/app-common/src/main/res/layout/fragment_profile_rename.xml +++ b/app-common/src/main/res/layout/fragment_profile_rename.xml @@ -8,8 +8,6 @@ android:id="@+id/toolbar" android:layout_width="0dp" android:layout_height="wrap_content" - android:theme="@style/Theme.OpenEUICC" - android:elevation="4dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintWidth_percent="1" diff --git a/app-common/src/main/res/values/themes.xml b/app-common/src/main/res/values/themes.xml index c3788bc..17a1db7 100644 --- a/app-common/src/main/res/values/themes.xml +++ b/app-common/src/main/res/values/themes.xml @@ -1,15 +1,14 @@ -