1
0
Fork 0

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".
master
mihai-adrian 2019-07-26 10:51:31 +03:00 committed by Emily Kager
parent 2e300fc8cf
commit ef3c813aee
1 changed files with 8 additions and 8 deletions

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()
}
}