themes: Switch to single theme for all activities

Default to NoActionBar theme and use toolbar where required

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta 2024-06-22 15:35:01 +05:30
parent 12fb4d13d4
commit 412ed9ee16
5 changed files with 21 additions and 21 deletions

View file

@ -105,7 +105,6 @@
<activity
android:name=".ui.storage.StorageActivity"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustResize" />
<activity
@ -115,15 +114,13 @@
<activity
android:name=".ui.recoverycode.RecoveryCodeActivity"
android:label="@string/recovery_code_title"
android:theme="@style/AppTheme.NoActionBar" />
android:label="@string/recovery_code_title" />
<activity
android:name=".restore.RestoreActivity"
android:exported="true"
android:label="@string/restore_title"
android:permission="com.stevesoltys.seedvault.RESTORE_BACKUP"
android:theme="@style/AppTheme.NoActionBar">
android:permission="com.stevesoltys.seedvault.RESTORE_BACKUP">
<intent-filter>
<action android:name="com.stevesoltys.seedvault.RESTORE_BACKUP" />
<category android:name="android.intent.category.DEFAULT" />

View file

@ -34,6 +34,7 @@ class SettingsActivity : RequireProvisioningActivity(), OnPreferenceStartFragmen
setContentView(R.layout.activity_fragment_container)
setSupportActionBar(requireViewById(R.id.toolbar))
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
// always start with settings fragment as a base (when fresh start)

View file

@ -3,7 +3,21 @@
SPDX-FileCopyrightText: 2020 The Calyx Institute
SPDX-License-Identifier: Apache-2.0
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:theme="?attr/actionBarTheme" />
<FrameLayout
android:id="@+id/fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>

View file

@ -13,8 +13,6 @@
<color name="primaryDark">@color/primary</color>
<!-- https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-14.0.0_r1/core/res/res/values/colors_device_defaults.xml#52 -->
<color name="background">@android:color/system_neutral1_50</color>
<!-- https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-14.0.0_r1/core/res/res/values/colors_device_defaults.xml#21 -->
<color name="actionBarPrimary">@color/primary</color>
<!-- https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-14.0.0_r1/core/res/res/values/colors_device_defaults.xml#23 -->
<color name="statusBarColor">@color/primary</color>
<!-- https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-14.0.0_r1/core/res/res/values/colors_device_defaults.xml#69 -->

View file

@ -4,7 +4,7 @@
-->
<resources>
<style name="AppTheme" parent="@style/Theme.AppCompat.DayNight">
<style name="AppTheme" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primaryDark</item>
<item name="colorAccent">@color/accent</item>
@ -14,20 +14,10 @@
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="android:windowLightStatusBar">@bool/isLight</item>
<item name="android:statusBarColor">@color/statusBarColor</item>
<item name="actionBarTheme">@style/Theme.ActionBar</item>
<item name="android:windowLightNavigationBar">@bool/isLight</item>
<item name="android:navigationBarColor">@color/primary</item>
</style>
<style name="Theme.ActionBar" parent="Theme.AppCompat.DayNight.DarkActionBar">
<item name="colorPrimary">@color/actionBarPrimary</item>
</style>
<style name="AppTheme.NoActionBar" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<!-- Copied from Settings -->
<style name="ActionPrimaryButton" parent="android:Widget.DeviceDefault.Button.Colored" />