2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

fixes #4237 - Cannot edit the default name of a collection, only replace it

changed setting of text to be done before transition, preventing transition to make textView unclickable;
 added renaming situation to showKeyboard in onResume();
 changed title text when renaming, from: "Name collection" to "Rename collection".
This commit is contained in:
mihai-adrian 2019-07-26 10:51:31 +03:00 committed by Emily Kager
parent 2e300fc8cf
commit ef3c813aee

View File

@ -267,7 +267,6 @@ class CollectionCreationUIView(
}
is SaveCollectionStep.RenameCollection -> {
view.tab_list.isClickable = false
name_collection_edittext.isClickable = true
it.selectedTabCollection?.let { tabCollection ->
tabCollection.tabs.map { tab ->
@ -281,7 +280,13 @@ class CollectionCreationUIView(
collectionCreationTabListAdapter.updateData(tabs, tabs.toSet(), true)
}
}
val constraint = nameCollectionConstraints
constraint.applyTo(view.collection_constraint_layout)
name_collection_edittext.setText(it.selectedTabCollection?.title)
name_collection_edittext.setSelection(0, name_collection_edittext.text.length)
back_button.text =
view.context.getString(R.string.collection_rename)
back_button.setOnClickListener {
name_collection_edittext.hideKeyboard()
val handler = Handler()
@ -306,19 +311,14 @@ class CollectionCreationUIView(
view.collection_constraint_layout,
transition
)
val constraint = nameCollectionConstraints
constraint.applyTo(view.collection_constraint_layout)
name_collection_edittext.setText(it.selectedTabCollection?.title)
name_collection_edittext.setSelection(0, name_collection_edittext.text.length)
back_button.text =
view.context.getString(R.string.create_collection_name_collection)
}
}
collectionSaveListAdapter.updateData(it.tabCollections, it.selectedTabs)
}
fun onResumed() {
if (step == SaveCollectionStep.NameCollection) {
if (step == SaveCollectionStep.NameCollection || step == SaveCollectionStep.RenameCollection) {
view.name_collection_edittext.showKeyboard()
}
}