Fix disabled preference text color

pull/437/head
Alex Baker 8 years ago
parent 385e19c363
commit e81bcbd5f2

@ -141,7 +141,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private final Map<String, TagData> tagMap = new HashMap<>();
private final int textColorPrimary;
private final int textColorSecondary;
private final int textColorHint;
private final int textColorOverdue;
@ -173,7 +172,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
displayMetrics = new DisplayMetrics();
fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
textColorPrimary = getData(context, android.R.attr.textColorPrimary);
textColorSecondary = getData(context, android.R.attr.textColorSecondary);
textColorHint = getData(context, android.R.attr.textColorTertiary);
textColorOverdue = resources.getColor(R.color.overdue);
@ -474,14 +472,14 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
* uncompleted.
*/
protected void setTaskAppearance(ViewHolder viewHolder, Task task) {
boolean state = task.isCompleted();
boolean completed = task.isCompleted();
TextView name = viewHolder.nameView;
if(state) {
name.setTextColor(textColorHint);
if (completed) {
name.setEnabled(false);
name.setPaintFlags(name.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
} else {
name.setTextColor(textColorPrimary);
name.setEnabled(true);
name.setPaintFlags(name.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
name.setTextSize(fontSize);

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_enabled="false" android:color="@color/white_50"/>
<item android:color="@color/white_100"/>
</selector>

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
** Copyright (c) 2012 Todoroo Inc
**
** See the file "LICENSE" for the full license governing this code.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_checked="true"
android:color="@android:color/white"/>
<item android:state_checked="false"
android:color="@color/task_edit_deadline_gray"/>
</selector>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_enabled="false" android:color="@color/black_38"/>
<item android:color="@color/black_87"/>
</selector>

@ -51,6 +51,7 @@
android:layout_height="wrap_content"
android:layout_weight="100"
android:ellipsize="end"
android:textColor="?android:attr/textColorPrimary"
android:gravity="start|center_vertical"
android:textAlignment="viewStart"
android:maxLines="1"

@ -5,7 +5,6 @@
<color name="icon_tint">@color/icon_tint_dark</color>
<color name="drawer_color">@color/drawer_background_dark</color>
<color name="drawer_color_selected">@color/drawer_background_dark_selected</color>
<color name="text_primary">@color/white_100</color>
<color name="text_secondary">@color/white_70</color>
<color name="text_tertiary">@color/white_50</color>
<color name="divider">@color/white_12</color>

@ -5,7 +5,6 @@
<color name="icon_tint">@color/icon_tint_light</color>
<color name="drawer_color">@color/drawer_background_light</color>
<color name="drawer_color_selected">@color/drawer_background_light_selected</color>
<color name="text_primary">@color/black_87</color>
<color name="text_secondary">@color/black_54</color>
<color name="text_tertiary">@color/black_38</color>
<color name="divider">@color/black_12</color>

Loading…
Cancel
Save