Keep hidden task indicator aligned to top

pull/996/head
Alex Baker 5 years ago
parent 697f658c42
commit 6f09bc6484

@ -72,6 +72,9 @@ public class ViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.chip_group) @BindView(R.id.chip_group)
ChipGroup chipGroup; ChipGroup chipGroup;
@BindView(R.id.hidden_icon)
View hiddenIcon;
private int indent; private int indent;
private boolean selected; private boolean selected;
private boolean moving; private boolean moving;
@ -122,7 +125,7 @@ public class ViewHolder extends RecyclerView.ViewHolder {
description.setEllipsize(null); description.setEllipsize(null);
} }
setTopPadding(rowPadding, nameView, completeBox, dueDate); setTopPadding(rowPadding, nameView, completeBox, dueDate, hiddenIcon);
setBottomPadding(rowPadding, completeBox, dueDate); setBottomPadding(rowPadding, completeBox, dueDate);
nameView.setTextSize(fontSize); nameView.setTextSize(fontSize);
@ -197,8 +200,7 @@ public class ViewHolder extends RecyclerView.ViewHolder {
this.indent = task.indent; this.indent = task.indent;
nameView.setText(task.getTitle()); nameView.setText(task.getTitle());
TextViewCompat.setCompoundDrawablesRelativeWithIntrinsicBounds( hiddenIcon.setVisibility(task.isHidden() ? View.VISIBLE : View.GONE);
nameView, task.isHidden() ? R.drawable.ic_outline_visibility_off_24px : 0, 0, 0, 0);
setupTitleAndCheckbox(); setupTitleAndCheckbox();
setupDueDate(); setupDueDate();
if (preferences.getBoolean(R.string.p_show_list_indicators, true)) { if (preferences.getBoolean(R.string.p_show_list_indicators, true)) {

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rowBody" android:id="@+id/rowBody"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -17,7 +18,8 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:paddingStart="@dimen/keyline_first" android:paddingStart="@dimen/keyline_first"
android:paddingEnd="@dimen/keyline_second"/> android:paddingEnd="@dimen/keyline_second"
tools:src="@drawable/ic_outline_check_box_outline_blank_24px" />
<TextView <TextView
android:id="@+id/due_date" android:id="@+id/due_date"
@ -30,13 +32,25 @@
android:paddingEnd="@dimen/half_keyline_first" android:paddingEnd="@dimen/half_keyline_first"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:textSize="14sp"/> android:textSize="14sp"
tools:text="Tmrrw" />
<ImageView
android:id="@+id/hidden_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/completeBox"
android:paddingEnd="2dp"
android:paddingStart="0dp"
android:src="@drawable/ic_outline_visibility_off_24px"
android:tint="@color/icon_tint_with_alpha"
android:contentDescription="@string/widget_due_date_hidden" />
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toEndOf="@id/completeBox" android:layout_toEndOf="@id/hidden_icon"
android:layout_toStartOf="@id/due_date" android:layout_toStartOf="@id/due_date"
android:paddingStart="0dp" android:paddingStart="0dp"
android:paddingEnd="@dimen/half_keyline_first" android:paddingEnd="@dimen/half_keyline_first"
@ -48,7 +62,9 @@
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/task_edit_text_size" android:textSize="@dimen/task_edit_text_size"
android:drawablePadding="2dp" android:drawablePadding="2dp"
app:drawableTint="@color/icon_tint_with_alpha"/> app:drawableTint="@color/icon_tint_with_alpha"
tools:text="Task title"
tools:textColor="@color/text_primary" />
<TextView <TextView
android:id="@+id/description" android:id="@+id/description"
@ -64,7 +80,8 @@
android:textAlignment="viewStart" android:textAlignment="viewStart"
android:textColor="?android:textColorSecondary" android:textColor="?android:textColorSecondary"
android:textSize="@dimen/task_edit_text_size" android:textSize="@dimen/task_edit_text_size"
android:visibility="gone"/> android:visibility="gone"
tools:text="Task description" />
<com.google.android.material.chip.ChipGroup <com.google.android.material.chip.ChipGroup
android:id="@+id/chip_group" android:id="@+id/chip_group"
@ -76,6 +93,6 @@
android:layout_marginEnd="@dimen/keyline_first" android:layout_marginEnd="@dimen/keyline_first"
android:visibility="gone" android:visibility="gone"
app:chipSpacingHorizontal="@dimen/chip_spacing" app:chipSpacingHorizontal="@dimen/chip_spacing"
app:chipSpacingVertical="@dimen/chip_spacing"/> app:chipSpacingVertical="@dimen/chip_spacing" />
</RelativeLayout> </RelativeLayout>
Loading…
Cancel
Save