From 6f09bc648409e1d0b1118143e41ce62043a457dc Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 16 Apr 2020 10:40:37 -0500 Subject: [PATCH] Keep hidden task indicator aligned to top --- .../java/org/tasks/tasklist/ViewHolder.java | 8 +- .../main/res/layout/task_adapter_row_body.xml | 77 +++++++++++-------- 2 files changed, 52 insertions(+), 33 deletions(-) diff --git a/app/src/main/java/org/tasks/tasklist/ViewHolder.java b/app/src/main/java/org/tasks/tasklist/ViewHolder.java index 58a06a5dc..c396db63a 100644 --- a/app/src/main/java/org/tasks/tasklist/ViewHolder.java +++ b/app/src/main/java/org/tasks/tasklist/ViewHolder.java @@ -72,6 +72,9 @@ public class ViewHolder extends RecyclerView.ViewHolder { @BindView(R.id.chip_group) ChipGroup chipGroup; + @BindView(R.id.hidden_icon) + View hiddenIcon; + private int indent; private boolean selected; private boolean moving; @@ -122,7 +125,7 @@ public class ViewHolder extends RecyclerView.ViewHolder { description.setEllipsize(null); } - setTopPadding(rowPadding, nameView, completeBox, dueDate); + setTopPadding(rowPadding, nameView, completeBox, dueDate, hiddenIcon); setBottomPadding(rowPadding, completeBox, dueDate); nameView.setTextSize(fontSize); @@ -197,8 +200,7 @@ public class ViewHolder extends RecyclerView.ViewHolder { this.indent = task.indent; nameView.setText(task.getTitle()); - TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds( - nameView, task.isHidden() ? R.drawable.ic_outline_visibility_off_24px : 0, 0, 0, 0); + hiddenIcon.setVisibility(task.isHidden() ? View.VISIBLE : View.GONE); setupTitleAndCheckbox(); setupDueDate(); if (preferences.getBoolean(R.string.p_show_list_indicators, true)) { diff --git a/app/src/main/res/layout/task_adapter_row_body.xml b/app/src/main/res/layout/task_adapter_row_body.xml index 359546183..4a0147d1b 100644 --- a/app/src/main/res/layout/task_adapter_row_body.xml +++ b/app/src/main/res/layout/task_adapter_row_body.xml @@ -1,6 +1,7 @@ + android:paddingEnd="@dimen/keyline_second" + tools:src="@drawable/ic_outline_check_box_outline_blank_24px" /> + android:textSize="14sp" + tools:text="Tmrrw" /> + + + app:drawableTint="@color/icon_tint_with_alpha" + tools:text="Task title" + tools:textColor="@color/text_primary" /> - + - + \ No newline at end of file