From 0f609b18886eee606a80b25cafac06a523c242b3 Mon Sep 17 00:00:00 2001 From: Sparky93 Date: Wed, 19 Feb 2020 18:46:06 +0200 Subject: [PATCH] Fix for #8533 - Migration screen's buttons in the wrong place Made a small refactor on the migration screen layout in order to correctly position the elements. --- .../migration/MigrationProgressActivity.kt | 17 +-- .../main/res/layout/activity_migration.xml | 122 +++++++++--------- app/src/main/res/values/dimens.xml | 7 +- 3 files changed, 68 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/migration/MigrationProgressActivity.kt b/app/src/main/java/org/mozilla/fenix/migration/MigrationProgressActivity.kt index a4595357c..f8ffce98b 100644 --- a/app/src/main/java/org/mozilla/fenix/migration/MigrationProgressActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/migration/MigrationProgressActivity.kt @@ -57,7 +57,12 @@ class MigrationProgressActivity : AbstractMigrationProgressActivity() { text = context.getString(R.string.migration_title, appName) } - migration_button.apply { + migration_button_text_view.text = getString(R.string.migration_updating_app_button_text, appName) + } + + override fun onMigrationCompleted(results: MigrationResults) { + // Enable clicking the finish button + migration_button_text_view.apply { setOnClickListener { AbstractMigrationService.dismissNotification(context) @@ -71,18 +76,10 @@ class MigrationProgressActivity : AbstractMigrationProgressActivity() { startActivity(intent) } } - text = getString(R.string.migration_updating_app_button_text, appName) - } - } - - override fun onMigrationCompleted(results: MigrationResults) { - // Enable clicking the finish button - migration_button.apply { - isEnabled = true text = getString(R.string.migration_update_app_button, getString(R.string.app_name)) - setBackgroundResource(R.drawable.button_background) setTextColor(ContextCompat.getColor(context, R.color.white_color)) } + migration_button.setBackgroundResource(R.drawable.button_background) migration_button_progress_bar.visibility = View.INVISIBLE // Keep the results list up-to-date. statusAdapter.submitList(results.toItemList()) diff --git a/app/src/main/res/layout/activity_migration.xml b/app/src/main/res/layout/activity_migration.xml index 2b0443d38..59f9a451e 100644 --- a/app/src/main/res/layout/activity_migration.xml +++ b/app/src/main/res/layout/activity_migration.xml @@ -15,34 +15,17 @@ android:layout_marginStart="@dimen/migration_margin_horizontal_large" android:importantForAccessibility="no" app:layout_constraintBottom_toBottomOf="@+id/migration_welcome_title" - app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/migration_welcome_title" - app:srcCompat="@drawable/ic_firefox" /> - - + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toLeftOf="@id/migration_welcome_title" + app:srcCompat="@drawable/ic_firefox"/> + app:layout_constraintLeft_toRightOf="@id/migration_firefox_logo" + app:layout_constraintRight_toRightOf="parent" + tools:text="Welcome to the all-new Firefox Preview" + app:layout_constraintVertical_chainStyle="spread"/> + + - + app:layout_constraintTop_toBottomOf="@id/migration_status_list" + android:gravity="center" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + android:background="@drawable/button_background_grey" + android:orientation="horizontal"> - + - + - + + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 8d2425107..999f9c6d1 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -104,16 +104,15 @@ 12sp - 32dp 24dp - 16dp - 8dp + 16dp 48dp 16sp 20sp 24dp - 8dp + 8dp 4dp + 44dp 10dp