Flip expand/collapse indicators

pull/1100/head
Alex Baker 5 years ago
parent c396592575
commit bb5f3bc23a

@ -58,7 +58,7 @@ internal class SubheaderViewHolder(
DrawableUtil.setRightDrawable( DrawableUtil.setRightDrawable(
itemView.context, itemView.context,
text, text,
if (subheader.isCollapsed) R.drawable.ic_keyboard_arrow_up_black_18dp else R.drawable.ic_keyboard_arrow_down_black_18dp) if (subheader.isCollapsed) R.drawable.ic_keyboard_arrow_down_black_18dp else R.drawable.ic_keyboard_arrow_up_black_18dp)
} }
init { init {

@ -31,7 +31,7 @@ class HeaderViewHolder(
} else { } else {
this.header.visibility = View.VISIBLE this.header.visibility = View.VISIBLE
this.header.text = header this.header.text = header
this.header.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, if (section.collapsed) R.drawable.ic_keyboard_arrow_up_black_18dp else R.drawable.ic_keyboard_arrow_down_black_18dp, 0) this.header.setCompoundDrawablesRelativeWithIntrinsicBounds(0, 0, if (section.collapsed) R.drawable.ic_keyboard_arrow_down_black_18dp else R.drawable.ic_keyboard_arrow_up_black_18dp, 0)
this.header.setTextColor( this.header.setTextColor(
context.getColor( context.getColor(
if (sortMode == SortHelper.SORT_DUE && sortGroup > 0 && newDateTime(sortGroup).plusDays(1).startOfDay().isBeforeNow) R.color.overdue else R.color.text_secondary)) if (sortMode == SortHelper.SORT_DUE && sortGroup > 0 && newDateTime(sortGroup).plusDays(1).startOfDay().isBeforeNow) R.color.overdue else R.color.text_secondary))

@ -50,7 +50,7 @@ class ChipProvider @Inject constructor(
val chip = newChip(task) val chip = newChip(task)
apply( apply(
chip, chip,
if (task.isCollapsed) R.drawable.ic_keyboard_arrow_up_black_24dp else R.drawable.ic_keyboard_arrow_down_black_24dp, if (task.isCollapsed) R.drawable.ic_keyboard_arrow_down_black_24dp else R.drawable.ic_keyboard_arrow_up_black_24dp,
if (compact) locale.formatNumber(task.children) else activity if (compact) locale.formatNumber(task.children) else activity
.resources .resources
.getQuantityString(R.plurals.subtask_count, task.children, task.children), .getQuantityString(R.plurals.subtask_count, task.children, task.children),

@ -181,7 +181,7 @@ internal class ScrollableViewsFactory(
R.plurals.subtask_count, taskContainer.children, taskContainer.children)) R.plurals.subtask_count, taskContainer.children, taskContainer.children))
row.setImageViewResource( row.setImageViewResource(
R.id.subtask_icon, R.id.subtask_icon,
if (taskContainer.isCollapsed) R.drawable.ic_keyboard_arrow_up_black_18dp else R.drawable.ic_keyboard_arrow_down_black_18dp) if (taskContainer.isCollapsed) R.drawable.ic_keyboard_arrow_down_black_18dp else R.drawable.ic_keyboard_arrow_up_black_18dp)
row.setViewVisibility(R.id.subtask_button, View.VISIBLE) row.setViewVisibility(R.id.subtask_button, View.VISIBLE)
} else { } else {
row.setViewVisibility(R.id.subtask_button, View.GONE) row.setViewVisibility(R.id.subtask_button, View.GONE)

Loading…
Cancel
Save