Indicate uneditable tasks with a special background color

pull/14/head
Sam Bosley 13 years ago
parent 14a13fe241
commit 1672427b0a

@ -31,7 +31,8 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignTop="@id/user_image"
android:layout_toRightOf="@id/user_image"/>
android:layout_toRightOf="@id/user_image"
android:textColor="@android:color/black"/>
</RelativeLayout>

@ -28,6 +28,7 @@
<attr name="asThemeTextColor" format="color"/>
<attr name="asEditTextBackground" format="reference"/>
<attr name="asReadonlyTaskBackground" format="color" />
<attr name="asListsDisclosure" format="reference"/>
<attr name="asAddButtonImg" format="reference" />
<attr name="asMicButtonImg" format="reference" />

@ -42,6 +42,7 @@
<item name="asListArrowUp">@drawable/list_arrow_up_white</item>
<item name="asFilterSelectedIcon">@drawable/filter_selected_icon</item>
<item name="asTaskRowSelector">@drawable/task_row_bg_dark</item>
<item name="asReadonlyTaskBackground">#322c19</item>
<!-- actionbar-styling -->
<item name="abBackground">@drawable/header_blue</item>
@ -93,6 +94,7 @@
<item name="asListArrowUp">@drawable/list_arrow_up</item>
<item name="asFilterSelectedIcon">@drawable/filter_selected_icon_black</item>
<item name="asTaskRowSelector">@drawable/task_row_bg_white</item>
<item name="asReadonlyTaskBackground">#fff6d7</item>
<!-- actionbar-styling -->
<item name="abBackground">@drawable/header_red</item>

@ -37,6 +37,7 @@ import android.text.Spanned;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
@ -192,6 +193,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
protected int applyListeners = APPLY_LISTENERS_PARENT;
private long mostRecentlyMade = -1;
private final ScaleAnimation scaleAnimation;
private final int readonlyBackground;
private final AtomicReference<String> query;
@ -251,6 +253,10 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setDuration(100);
TypedValue readonlyBg = new TypedValue();
fragment.getActivity().getTheme().resolveAttribute(R.attr.asReadonlyTaskBackground, readonlyBg, false);
readonlyBackground = readonlyBg.data;
}
private int computeMinRowHeight() {
@ -401,6 +407,11 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
viewHolder.completeBox.setMinimumHeight(minRowHeight);
}
if (task.isEditable())
viewHolder.view.setBackgroundColor(resources.getColor(android.R.color.transparent));
else
viewHolder.view.setBackgroundColor(readonlyBackground);
// name
final TextView nameView = viewHolder.nameView; {
String nameValue = task.getValue(Task.TITLE);

Loading…
Cancel
Save