Fix click on hidden task titles

pull/996/head
Alex Baker 4 years ago
parent 6d44ffc130
commit 1ff0229910

@ -11,6 +11,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import androidx.core.widget.TextViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
@ -226,10 +227,12 @@ public class ViewHolder extends RecyclerView.ViewHolder {
private void setupTitleAndCheckbox() {
if (task.isCompleted()) {
nameView.setEnabled(false);
nameView.setTextColor(ContextCompat.getColor(context, R.color.text_tertiary));
nameView.setPaintFlags(nameView.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
nameView.setEnabled(!task.isHidden());
nameView.setTextColor(
ContextCompat.getColor(
context, task.isHidden() ? R.color.text_tertiary : R.color.text_primary));
nameView.setPaintFlags(nameView.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}

Loading…
Cancel
Save