From 412ed9ee16142bf6cf5c3395bd6e281265daf069 Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sat, 22 Jun 2024 15:35:01 +0530 Subject: [PATCH 01/10] themes: Switch to single theme for all activities Default to NoActionBar theme and use toolbar where required Signed-off-by: Aayush Gupta --- app/src/main/AndroidManifest.xml | 7 ++----- .../seedvault/settings/SettingsActivity.kt | 1 + .../layout/activity_fragment_container.xml | 20 ++++++++++++++++--- app/src/main/res/values/colors.xml | 2 -- app/src/main/res/values/themes.xml | 12 +---------- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index ac2a4665..4a4351e6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -105,7 +105,6 @@ + android:label="@string/recovery_code_title" /> + android:permission="com.stevesoltys.seedvault.RESTORE_BACKUP"> diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsActivity.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsActivity.kt index 436a040b..6697e3f4 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsActivity.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/SettingsActivity.kt @@ -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) diff --git a/app/src/main/res/layout/activity_fragment_container.xml b/app/src/main/res/layout/activity_fragment_container.xml index a9744b96..a688348d 100644 --- a/app/src/main/res/layout/activity_fragment_container.xml +++ b/app/src/main/res/layout/activity_fragment_container.xml @@ -3,7 +3,21 @@ SPDX-FileCopyrightText: 2020 The Calyx Institute SPDX-License-Identifier: Apache-2.0 --> - + android:layout_height="match_parent" + android:orientation="vertical"> + + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 30dbd156..0e00c947 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -13,8 +13,6 @@ @color/primary @android:color/system_neutral1_50 - - @color/primary @color/primary diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index f5e767a9..5b00ae32 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -4,7 +4,7 @@ --> - - - - - @@ -75,7 +74,7 @@ gravity - - + + From 07116b4f4c46c845035deef630d9ff36d1d7143f Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 24 Jun 2024 10:24:46 -0300 Subject: [PATCH 07/10] Use MD3 switches for files backup config --- .../calyxos/backup/storage/ui/backup/BackupContentAdapter.kt | 4 ++-- storage/lib/src/main/res/layout/item_media.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentAdapter.kt b/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentAdapter.kt index 854df079..50d8fd35 100644 --- a/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentAdapter.kt +++ b/storage/lib/src/main/java/org/calyxos/backup/storage/ui/backup/BackupContentAdapter.kt @@ -12,9 +12,9 @@ import android.view.ViewGroup import android.widget.ImageButton import android.widget.ImageView import android.widget.TextView -import androidx.appcompat.widget.SwitchCompat import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView.Adapter +import com.google.android.material.materialswitch.MaterialSwitch import org.calyxos.backup.storage.R import org.calyxos.backup.storage.api.EXTERNAL_STORAGE_PROVIDER_AUTHORITY @@ -65,7 +65,7 @@ internal class BackupContentAdapter(private val listener: ContentClickListener) } internal inner class MediaHolder(view: View) : ViewHolder(view) { - private val switch: SwitchCompat = view.findViewById(R.id.switchView) + private val switch: MaterialSwitch = view.findViewById(R.id.switchView) override fun bind(item: BackupContentItem) { super.bind(item) diff --git a/storage/lib/src/main/res/layout/item_media.xml b/storage/lib/src/main/res/layout/item_media.xml index 7c357472..71db589b 100644 --- a/storage/lib/src/main/res/layout/item_media.xml +++ b/storage/lib/src/main/res/layout/item_media.xml @@ -42,7 +42,7 @@ app:layout_constraintTop_toTopOf="parent" tools:text="@string/content_videos" /> - Date: Tue, 2 Jul 2024 12:30:57 +0700 Subject: [PATCH 08/10] drawable: Tint colors directly instead of relying on system theme Material theme seems to be not respecting the tint color in the XML. Override the colors manually to get the job done. Signed-off-by: Aayush Gupta --- app/src/main/res/drawable/ic_app_settings.xml | 2 +- app/src/main/res/drawable/ic_call.xml | 2 +- app/src/main/res/drawable/ic_contacts.xml | 2 +- app/src/main/res/drawable/ic_message.xml | 2 +- app/src/main/res/drawable/ic_settings.xml | 2 +- app/src/main/res/values/colors.xml | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/res/drawable/ic_app_settings.xml b/app/src/main/res/drawable/ic_app_settings.xml index be2e27ef..567eb667 100644 --- a/app/src/main/res/drawable/ic_app_settings.xml +++ b/app/src/main/res/drawable/ic_app_settings.xml @@ -1,7 +1,7 @@ diff --git a/app/src/main/res/drawable/ic_call.xml b/app/src/main/res/drawable/ic_call.xml index b67ffd6b..8d9dfc5d 100644 --- a/app/src/main/res/drawable/ic_call.xml +++ b/app/src/main/res/drawable/ic_call.xml @@ -6,7 +6,7 @@ @android:color/system_neutral1_50 - - @*android:color/error_color_device_default_dark + + #ff7043 @color/accent_primary From 3f7022ecb737730a58ccbe9676d77163063cf1bd Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Thu, 11 Jul 2024 16:57:06 +0700 Subject: [PATCH 09/10] fragment_restore_app_selection: Set background color to squashed layout CollapsingToolbarLayout doesn't seems to be respecting background color for some reason Signed-off-by: Aayush Gupta --- app/src/main/res/layout/fragment_restore_app_selection.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_restore_app_selection.xml b/app/src/main/res/layout/fragment_restore_app_selection.xml index 36f68bf5..07f215d3 100644 --- a/app/src/main/res/layout/fragment_restore_app_selection.xml +++ b/app/src/main/res/layout/fragment_restore_app_selection.xml @@ -16,7 +16,8 @@ + android:layout_height="wrap_content" + android:background="@color/background"> Date: Fri, 26 Jul 2024 15:14:04 +0700 Subject: [PATCH 10/10] Apply dynamic colors to all acitvites Signed-off-by: Aayush Gupta --- app/src/main/java/com/stevesoltys/seedvault/App.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/stevesoltys/seedvault/App.kt b/app/src/main/java/com/stevesoltys/seedvault/App.kt index 053af85f..9389eb05 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/App.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/App.kt @@ -20,6 +20,7 @@ import android.os.UserManager import android.provider.Settings import androidx.work.ExistingPeriodicWorkPolicy.UPDATE import androidx.work.WorkManager +import com.google.android.material.color.DynamicColors import com.stevesoltys.seedvault.crypto.cryptoModule import com.stevesoltys.seedvault.header.headerModule import com.stevesoltys.seedvault.metadata.MetadataManager @@ -114,6 +115,7 @@ open class App : Application() { override fun onCreate() { super.onCreate() + DynamicColors.applyToActivitiesIfAvailable(this) startKoin() if (isDebugBuild()) { StrictMode.setThreadPolicy(