Skip to content

Commit

Permalink
Bug fix #2064. Updated Task Notes expanded state logic (#2077)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh-thiyagarajan authored Sep 5, 2024
1 parent 2d5dc6f commit 5a27d7c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ abstract class BaseTaskViewHolder(
notesTextView?.movementMethod = LinkMovementMethod.getInstance()
titleTextView.movementMethod = LinkMovementMethod.getInstance()

expandNotesButton?.setOnClickListener { expandTask() }
expandNotesButton?.setOnClickListener {
notesExpanded = !notesExpanded
updateExpandedTaskLogic()
}
iconViewChallenge?.setOnClickListener {
task?.let { t ->
if (task?.challengeBroken?.isNotBlank() == true) brokenTaskFunc(t)
Expand All @@ -127,8 +130,7 @@ abstract class BaseTaskViewHolder(
context = itemView.context
}

private fun expandTask() {
notesExpanded = !notesExpanded
private fun updateExpandedTaskLogic() {
if (notesExpanded) {
notesTextView?.maxLines = 100
expandNotesButton?.text = context.getString(R.string.collapse_notes)
Expand Down Expand Up @@ -162,6 +164,7 @@ abstract class BaseTaskViewHolder(
if (data.notes?.isNotEmpty() == true) {
notesTextView?.visibility = View.VISIBLE
notesTextView?.setTextColor(ContextCompat.getColor(context, R.color.text_ternary))
updateExpandedTaskLogic()
} else {
notesTextView?.visibility = View.GONE
}
Expand Down

0 comments on commit 5a27d7c

Please sign in to comment.