From 4576c6d332088a74ec5c98f10c2ee6d927aae73d Mon Sep 17 00:00:00 2001 From: Michael W Date: Tue, 3 May 2022 20:14:55 +0200 Subject: [PATCH] Seedvault: Redesign SUW activities for 12 * New SetupWizard uses external/setupdesign (sud) and external/setupcompat (suc) to achieve the desired looks * It prevents proper previews when included in any app, though, so we better try achieving the same by manually styling the activities for 12 * This patch mimics the design by applying styles similar to the ones from sud, sometimes reusing parts taken from there Change-Id: Iccf588e5239aeb00645f97b095910986f32c52d0 --- .../restore/RestoreProgressFragment.kt | 3 - .../install/InstallProgressFragment.kt | 3 - .../ui/storage/StorageOptionsFragment.kt | 3 - app/src/main/res/layout/footer_snapshots.xml | 4 +- .../layout/fragment_recovery_code_input.xml | 17 ++-- .../layout/fragment_recovery_code_output.xml | 6 +- .../layout/fragment_restore_files_started.xml | 17 ++-- .../res/layout/fragment_restore_progress.xml | 58 ++++++------- .../main/res/layout/fragment_restore_set.xml | 24 ++---- .../res/layout/fragment_storage_check.xml | 24 ++---- .../main/res/layout/fragment_storage_root.xml | 33 ++------ app/src/main/res/layout/header_snapshots.xml | 9 +- .../layout/list_item_app_section_title.xml | 5 +- .../main/res/layout/list_item_app_status.xml | 4 +- .../main/res/layout/list_item_restore_set.xml | 3 +- .../res/layout/list_item_storage_root.xml | 5 +- app/src/main/res/values-night/colors.xml | 2 +- app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/themes.xml | 83 ++++++++++++++++++- .../src/main/res/layout/fragment_snapshot.xml | 7 +- .../lib/src/main/res/layout/item_snapshot.xml | 14 ++-- 21 files changed, 174 insertions(+), 152 deletions(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressFragment.kt index 5c24f8bb..17bf9fc6 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressFragment.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/restore/RestoreProgressFragment.kt @@ -11,9 +11,7 @@ import android.widget.TextView import androidx.appcompat.app.AlertDialog import androidx.core.content.ContextCompat.getColor import androidx.fragment.app.Fragment -import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL import androidx.recyclerview.widget.RecyclerView import com.stevesoltys.seedvault.R import com.stevesoltys.seedvault.ui.AppBackupState.FAILED_NOT_INSTALLED @@ -54,7 +52,6 @@ class RestoreProgressFragment : Fragment() { appList.apply { layoutManager = this@RestoreProgressFragment.layoutManager adapter = this@RestoreProgressFragment.adapter - addItemDecoration(DividerItemDecoration(context, VERTICAL)) } button.setText(R.string.restore_finished_button) diff --git a/app/src/main/java/com/stevesoltys/seedvault/restore/install/InstallProgressFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/restore/install/InstallProgressFragment.kt index 5063385d..0bdfc507 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/restore/install/InstallProgressFragment.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/restore/install/InstallProgressFragment.kt @@ -15,9 +15,7 @@ import android.widget.Toast.LENGTH_LONG import androidx.activity.result.contract.ActivityResultContract import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment -import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.LinearLayoutManager.VERTICAL import androidx.recyclerview.widget.RecyclerView import com.stevesoltys.seedvault.R import com.stevesoltys.seedvault.restore.RestoreViewModel @@ -58,7 +56,6 @@ class InstallProgressFragment : Fragment(), InstallItemListener { appList.apply { layoutManager = this@InstallProgressFragment.layoutManager adapter = this@InstallProgressFragment.adapter - addItemDecoration(DividerItemDecoration(context, VERTICAL)) } button.setText(R.string.restore_next) button.setOnClickListener { viewModel.onNextClickedAfterInstallingApps() } diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageOptionsFragment.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageOptionsFragment.kt index a1e3eb69..62146332 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageOptionsFragment.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/storage/StorageOptionsFragment.kt @@ -44,7 +44,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener private lateinit var titleView: TextView private lateinit var warningIcon: ImageView private lateinit var warningText: TextView - private lateinit var divider: View private lateinit var listView: RecyclerView private lateinit var progressBar: ProgressBar private lateinit var skipView: TextView @@ -61,7 +60,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener titleView = v.findViewById(R.id.titleView) warningIcon = v.findViewById(R.id.warningIcon) warningText = v.findViewById(R.id.warningText) - divider = v.findViewById(R.id.divider) listView = v.findViewById(R.id.listView) progressBar = v.findViewById(R.id.progressBar) skipView = v.findViewById(R.id.skipView) @@ -93,7 +91,6 @@ internal class StorageOptionsFragment : Fragment(), StorageOptionClickedListener warningText.setText(R.string.storage_fragment_warning_delete) } warningText.visibility = VISIBLE - divider.visibility = VISIBLE } listView.adapter = adapter diff --git a/app/src/main/res/layout/footer_snapshots.xml b/app/src/main/res/layout/footer_snapshots.xml index d6c75b3b..0dda3f33 100644 --- a/app/src/main/res/layout/footer_snapshots.xml +++ b/app/src/main/res/layout/footer_snapshots.xml @@ -6,12 +6,12 @@ diff --git a/app/src/main/res/layout/fragment_recovery_code_input.xml b/app/src/main/res/layout/fragment_recovery_code_input.xml index 10f51f55..add2f192 100644 --- a/app/src/main/res/layout/fragment_recovery_code_input.xml +++ b/app/src/main/res/layout/fragment_recovery_code_input.xml @@ -60,29 +60,24 @@