Skip to content

Commit

Permalink
[fix] allows multiline entries for checklist items.
Browse files Browse the repository at this point in the history
  • Loading branch information
coderPaddyS committed Oct 22, 2024
1 parent e38866a commit c0320f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ class MainActivityViewModel(application: Application) : AndroidViewModel(applica
throw IllegalArgumentException("Only checklist notes allowed")
}
return ChecklistUtil.parse(note.content).map { (checked, name) ->
return@map Pair(checked, "[${if (checked) "x" else " "}] $name")
val preview = if (name.length > 30) name.take(30) + "..." else name.take(33)
return@map Pair(checked, "[${if (checked) "x" else " "}] $preview")
}
}

Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_checklist_note.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/etNewItem"
android:singleLine="true"
android:layout_weight="1"
android:hint="@string/hint_new_item"
android:textColor="?attr/colorOnBackground"
android:inputType="textCapSentences" />
android:inputType="textCapSentences|textMultiLine" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/item_checklist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="20sp"
android:inputType="text|textCapSentences"
android:inputType="text|textCapSentences|textMultiLine"
android:padding="10dp"
android:background="@null"/>

Expand Down

0 comments on commit c0320f9

Please sign in to comment.