Skip to content

Commit

Permalink
use constants
Browse files Browse the repository at this point in the history
Signed-off-by: sowjanyakch <[email protected]>
  • Loading branch information
sowjanyakch committed Feb 21, 2025
1 parent c108842 commit bfed721
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
val checkboxList = mutableListOf<CheckBox>()

matches.forEach { matchResult ->
val isChecked = matchResult.groupValues[2] == "X" || matchResult.groupValues[2] == "x"
val taskText = matchResult.groupValues[3].trim()
val isChecked = matchResult.groupValues[CHECKED_GROUP_INDEX] == "X" ||
matchResult.groupValues[CHECKED_GROUP_INDEX] == "x"
val taskText = matchResult.groupValues[TASK_TEXT_GROUP_INDEX].trim()

val checkBox = CheckBox(checkBoxContainer.context).apply {
text = taskText
Expand Down Expand Up @@ -341,5 +342,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) :
companion object {
const val TEXT_SIZE_MULTIPLIER = 2.5
private val TAG = IncomingTextMessageViewHolder::class.java.simpleName
private const val CHECKED_GROUP_INDEX = 2
private const val TASK_TEXT_GROUP_INDEX = 3
}
}

0 comments on commit bfed721

Please sign in to comment.