Fix new subtask rotation bug

pull/996/head
Alex Baker 4 years ago
parent 3801c46f31
commit 998f5b51d1

@ -154,8 +154,8 @@ class SubtaskControlSet : TaskEditControlFragment(), SubtaskViewHolder.Callbacks
val subtasks = ArrayList<Task>()
val children = newSubtaskContainer.childCount
for (i in 0 until children) {
val view = newSubtaskContainer.getChildAt(i)
val title = view.findViewById<EditText>(R.id.title)
val view = newSubtaskContainer.getChildAt(i) as ViewGroup
val title = view.getChildAt(2) as EditText
val completed: CheckableImageView = view.findViewById(R.id.completeBox)
val subtask = taskCreator.createWithValues(title.text.toString())
if (completed.isChecked) {
@ -194,8 +194,8 @@ class SubtaskControlSet : TaskEditControlFragment(), SubtaskViewHolder.Callbacks
val view = LayoutInflater.from(activity)
.inflate(R.layout.editable_subtask_adapter_row_body, newSubtaskContainer, false) as ViewGroup
view.findViewById<View>(R.id.clear).setOnClickListener { newSubtaskContainer.removeView(view) }
val editText = view.findViewById<EditText>(R.id.title)
editText.setTextKeepState(task.title)
val editText = view.getChildAt(2) as EditText
editText.setText(task.title)
editText.setHorizontallyScrolling(false)
editText.setLines(1)
editText.maxLines = Int.MAX_VALUE

@ -20,7 +20,6 @@
android:layout_alignParentEnd="true" />
<EditText
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/completeBox"

Loading…
Cancel
Save