From 5a23fb33f823d370e8ddb91435b181b5865bf3ea Mon Sep 17 00:00:00 2001 From: mcarare Date: Thu, 4 Jun 2020 17:46:19 +0300 Subject: [PATCH] For #11182: Fix back button text update according to save step. --- .../collections/CollectionCreationView.kt | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt index b4620d851..0edcb6c29 100644 --- a/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt +++ b/app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt @@ -141,20 +141,28 @@ class CollectionCreationView( private fun updateForSelectCollection() { tab_list.isClickable = false - - back_button.setOnClickListener { - interactor.onBackPressed(SaveCollectionStep.SelectCollection) - } - TransitionManager.beginDelayedTransition(collection_constraint_layout, transition) selectCollectionConstraints.clone( containerView.context, R.layout.component_collection_creation_select_collection ) selectCollectionConstraints.applyTo(collection_constraint_layout) + + back_button.apply { + text = context.getString(R.string.create_collection_select_collection) + setOnClickListener { + interactor.onBackPressed(SaveCollectionStep.SelectCollection) + } + } + TransitionManager.beginDelayedTransition(collection_constraint_layout, transition) } private fun updateForNameCollection(state: CollectionCreationState) { tab_list.isClickable = false + nameCollectionConstraints.clone( + containerView.context, + R.layout.component_collection_creation_name_collection + ) + nameCollectionConstraints.applyTo(collection_constraint_layout) collectionCreationTabListAdapter.updateData(state.selectedTabs.toList(), state.selectedTabs, true) back_button.apply { @@ -169,11 +177,7 @@ class CollectionCreationView( } name_collection_edittext.showKeyboard() - nameCollectionConstraints.clone( - containerView.context, - R.layout.component_collection_creation_name_collection - ) - nameCollectionConstraints.applyTo(collection_constraint_layout) + name_collection_edittext.setText( containerView.context.getString( R.string.create_collection_default_name,