Sort of apply material list guidelines to task row

pull/493/head
Alex Baker 9 years ago
parent df85ac4648
commit 1eb5d7ee80

@ -25,4 +25,8 @@ public class SyncAdapterHelper {
public boolean isEnabled() { public boolean isEnabled() {
return false; return false;
} }
public void requestSynchronization() {
}
} }

@ -25,4 +25,8 @@ public class SyncAdapterHelper {
public boolean isEnabled() { public boolean isEnabled() {
return false; return false;
} }
public void requestSynchronization() {
}
} }

@ -97,7 +97,7 @@ public class CommentsController {
if (items.size() > commentItems) { if (items.size() > commentItems) {
Button loadMore = new Button(activity); Button loadMore = new Button(activity);
loadMore.setText(R.string.TEA_load_more); loadMore.setText(R.string.TEA_load_more);
loadMore.setTextColor(getColor(activity, R.color.task_edit_deadline_gray)); loadMore.setTextColor(getColor(activity, R.color.text_secondary));
loadMore.setBackgroundColor(Color.alpha(0)); loadMore.setBackgroundColor(Color.alpha(0));
loadMore.setOnClickListener(v -> { loadMore.setOnClickListener(v -> {
// Perform action on click // Perform action on click

@ -20,7 +20,6 @@ import com.bignerdranch.android.multiselector.MultiSelectorBindingHolder;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.todoroo.andlib.data.TodorooCursor; import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DateUtilities;
import com.todoroo.andlib.utility.Pair;
import com.todoroo.astrid.adapter.TaskAdapter; import com.todoroo.astrid.adapter.TaskAdapter;
import com.todoroo.astrid.api.TaskAction; import com.todoroo.astrid.api.TaskAction;
import com.todoroo.astrid.core.LinkActionExposer; import com.todoroo.astrid.core.LinkActionExposer;
@ -38,16 +37,13 @@ import java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.OnLongClick;
import timber.log.Timber; import timber.log.Timber;
import static com.google.common.collect.Lists.newArrayList; import static com.google.common.collect.Lists.newArrayList;
import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop; import static com.todoroo.andlib.utility.AndroidUtilities.atLeastLollipop;
/**
* View Holder saves a lot of findViewById lookups.
*
* @author Tim Su <tim@todoroo.com>
*/
class ViewHolder extends MultiSelectorBindingHolder { class ViewHolder extends MultiSelectorBindingHolder {
@Override @Override
@ -72,7 +68,7 @@ class ViewHolder extends MultiSelectorBindingHolder {
updateBackground(); updateBackground();
} }
void updateBackground() { private void updateBackground() {
if (selected || moving) { if (selected || moving) {
rowBody.setBackgroundColor(selectedColor); rowBody.setBackgroundColor(selectedColor);
} else if (selectable) { } else if (selectable) {
@ -102,7 +98,6 @@ class ViewHolder extends MultiSelectorBindingHolder {
@BindView(R.id.completeBox) CheckableImageView completeBox; @BindView(R.id.completeBox) CheckableImageView completeBox;
@BindView(R.id.due_date) public TextView dueDate; @BindView(R.id.due_date) public TextView dueDate;
@BindView(R.id.tag_block) TextView tagBlock; @BindView(R.id.tag_block) TextView tagBlock;
@BindView(R.id.taskActionContainer) View taskActionContainer;
@BindView(R.id.taskActionIcon) ImageView taskActionIcon; @BindView(R.id.taskActionIcon) ImageView taskActionIcon;
public Task task; public Task task;
@ -111,7 +106,6 @@ class ViewHolder extends MultiSelectorBindingHolder {
private boolean hasFiles; // From join query, not part of the task model private boolean hasFiles; // From join query, not part of the task model
private boolean hasNotes; private boolean hasNotes;
private final Context context; private final Context context;
private final int fontSize;
private final CheckBoxes checkBoxes; private final CheckBoxes checkBoxes;
private final TagFormatter tagFormatter; private final TagFormatter tagFormatter;
private final int textColorSecondary; private final int textColorSecondary;
@ -123,7 +117,6 @@ class ViewHolder extends MultiSelectorBindingHolder {
private final int background; private final int background;
private final int selectedColor; private final int selectedColor;
private final int textColorOverdue; private final int textColorOverdue;
private Pair<Float, Float> lastTouchYRawY = new Pair<>(0f, 0f);
private int indent; private int indent;
private boolean selectable = false; private boolean selectable = false;
private boolean selected; private boolean selected;
@ -132,11 +125,10 @@ class ViewHolder extends MultiSelectorBindingHolder {
ViewHolder(Context context, ViewGroup view, boolean showFullTaskTitle, int fontSize, ViewHolder(Context context, ViewGroup view, boolean showFullTaskTitle, int fontSize,
CheckBoxes checkBoxes, TagFormatter tagFormatter, CheckBoxes checkBoxes, TagFormatter tagFormatter,
int textColorOverdue, int textColorSecondary, int textColorHint, TaskDao taskDao, int textColorOverdue, int textColorSecondary, int textColorHint, TaskDao taskDao,
DialogBuilder dialogBuilder, ViewHolderCallbacks callback, int minRowHeight, DialogBuilder dialogBuilder, ViewHolderCallbacks callback,
DisplayMetrics metrics, int background, int selectedColor, MultiSelector multiSelector) { DisplayMetrics metrics, int background, int selectedColor, MultiSelector multiSelector) {
super(view, multiSelector); super(view, multiSelector);
this.context = context; this.context = context;
this.fontSize = fontSize;
this.checkBoxes = checkBoxes; this.checkBoxes = checkBoxes;
this.tagFormatter = tagFormatter; this.tagFormatter = tagFormatter;
this.textColorOverdue = textColorOverdue; this.textColorOverdue = textColorOverdue;
@ -158,14 +150,21 @@ class ViewHolder extends MultiSelectorBindingHolder {
nameView.setEllipsize(null); nameView.setEllipsize(null);
} }
if (fontSize < 16) {
// developer.android.com/guide/practices/screens_support.html#dips-pels
int fontSizeInDP = (int) (fontSize * metrics.density + 0.5f);
rowBody.setPadding(0, fontSizeInDP, 0, fontSizeInDP);
}
nameView.setTextSize(fontSize);
int fontSizeDetails = Math.max(10, fontSize - 2);
dueDate.setTextSize(fontSizeDetails);
tagBlock.setTextSize(fontSizeDetails);
view.setTag(this); view.setTag(this);
for(int i = 0; i < view.getChildCount(); i++) { for(int i = 0; i < view.getChildCount(); i++) {
view.getChildAt(i).setTag(this); view.getChildAt(i).setTag(this);
} }
setMinimumHeight(minRowHeight);
addListeners();
} }
@SuppressLint("NewApi") @SuppressLint("NewApi")
@ -176,7 +175,7 @@ class ViewHolder extends MultiSelectorBindingHolder {
ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) row.getLayoutParams(); ViewGroup.MarginLayoutParams layoutParams = (ViewGroup.MarginLayoutParams) row.getLayoutParams();
layoutParams.setMarginStart(indentSize); layoutParams.setMarginStart(indentSize);
} else { } else {
rowBody.setPadding(indentSize, row.getPaddingTop(), 0, row.getPaddingBottom()); rowBody.setPadding(indentSize, rowBody.getPaddingTop(), 0, rowBody.getPaddingBottom());
} }
} }
@ -204,16 +203,6 @@ class ViewHolder extends MultiSelectorBindingHolder {
setTaskAppearance(); setTaskAppearance();
} }
private void setMinimumHeight(int minRowHeight) {
if (fontSize < 16) {
rowBody.setMinimumHeight(0);
completeBox.setMinimumHeight(0);
} else {
rowBody.setMinimumHeight(minRowHeight);
completeBox.setMinimumHeight(minRowHeight);
}
}
/** Helper method to set the contents and visibility of each field */ /** Helper method to set the contents and visibility of each field */
private synchronized void setFieldContentsAndVisibility() { private synchronized void setFieldContentsAndVisibility() {
String nameValue = task.getTitle(); String nameValue = task.getTitle();
@ -227,17 +216,14 @@ class ViewHolder extends MultiSelectorBindingHolder {
setupDueDateAndTags(); setupDueDateAndTags();
// Task action // Task action
ImageView taskAction = taskActionIcon; TaskAction action = getTaskAction(task, hasFiles, hasNotes);
if (taskAction != null) { if (action != null) {
TaskAction action = getTaskAction(task, hasFiles, hasNotes); taskActionIcon.setVisibility(View.VISIBLE);
if (action != null) { taskActionIcon.setImageResource(action.icon);
taskActionContainer.setVisibility(View.VISIBLE); taskActionIcon.setTag(action);
taskAction.setImageResource(action.icon); } else {
taskAction.setTag(action); taskActionIcon.setVisibility(View.GONE);
} else { taskActionIcon.setTag(null);
taskActionContainer.setVisibility(View.GONE);
taskAction.setTag(null);
}
} }
} }
@ -259,16 +245,9 @@ class ViewHolder extends MultiSelectorBindingHolder {
name.setEnabled(true); name.setEnabled(true);
name.setPaintFlags(name.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG); name.setPaintFlags(name.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
} }
name.setTextSize(fontSize);
setupDueDateAndTags(); setupDueDateAndTags();
float detailTextSize = Math.max(10, fontSize * 14 / 20);
if(dueDate != null) {
dueDate.setTextSize(detailTextSize);
dueDate.setTypeface(null, 0);
}
setupCompleteBox(); setupCompleteBox();
} }
@ -326,39 +305,47 @@ class ViewHolder extends MultiSelectorBindingHolder {
} }
} }
/** @OnClick(R.id.rowBody)
* Set listeners for this view. This is called once per view when it is void onRowBodyClick() {
* created. callback.onClick(this);
*/ }
private void addListeners() {
// check box listener @OnLongClick(R.id.rowBody)
View.OnTouchListener otl = (v, event) -> { boolean onRowBodyLongClick() {
lastTouchYRawY = new Pair<>(event.getY(), event.getRawY()); return callback.onLongPress(this);
return false; }
};
completeBox.setOnTouchListener(otl); @OnClick(R.id.completeBox)
completeBox.setOnClickListener(completeBoxListener); void onCompleteBoxClick(View v) {
if(task == null) {
rowBody.setOnClickListener(view -> callback.onClick(this)); return;
}
rowBody.setOnLongClickListener(view -> callback.onLongPress(this));
boolean newState = completeBox.isChecked();
if (taskActionContainer != null) {
taskActionContainer.setOnClickListener(v -> { if (newState != task.isCompleted()) {
TaskAction action = (TaskAction) taskActionIcon.getTag(); callback.onCompletedTask(task, newState);
if (action instanceof NotesAction) { taskDao.setComplete(task, newState);
showEditNotesDialog(task); }
} else if (action instanceof FilesAction) {
showFilesDialog(task); // set check box to actual action item state
} else if (action != null) { setTaskAppearance();
try { }
action.intent.send();
} catch (PendingIntent.CanceledException e) { @OnClick(R.id.taskActionIcon)
// Oh well void onTaskActionClick() {
Timber.e(e, e.getMessage()); TaskAction action = (TaskAction) taskActionIcon.getTag();
} if (action instanceof NotesAction) {
} showEditNotesDialog(task);
}); } else if (action instanceof FilesAction) {
showFilesDialog(task);
} else if (action != null) {
try {
action.intent.send();
} catch (PendingIntent.CanceledException e) {
// Oh well
Timber.e(e, e.getMessage());
}
} }
} }
@ -386,37 +373,4 @@ class ViewHolder extends MultiSelectorBindingHolder {
// filesControlSet.readFromTask(task); // filesControlSet.readFromTask(task);
// filesControlSet.getView().performClick(); // filesControlSet.getView().performClick();
} }
private final View.OnClickListener completeBoxListener = v -> {
int[] location = new int[2];
v.getLocationOnScreen(location);
if(Math.abs(location[1] + lastTouchYRawY.getLeft() - lastTouchYRawY.getRight()) > 10) {
completeBox.setChecked(!completeBox.isChecked());
return;
}
completeTask(task, completeBox.isChecked());
// set check box to actual action item state
setTaskAppearance();
};
/**
* This method is called when user completes a task via check box or other
* means
*
* @param newState
* state that this task should be set to
*/
private void completeTask(final Task task, final boolean newState) {
if(task == null) {
return;
}
if (newState != task.isCompleted()) {
callback.onCompletedTask(task, newState);
taskDao.setComplete(task, newState);
}
}
} }

@ -31,7 +31,6 @@ public class ViewHolderFactory {
private final int fontSize; private final int fontSize;
private final TaskDao taskDao; private final TaskDao taskDao;
private final DialogBuilder dialogBuilder; private final DialogBuilder dialogBuilder;
private final int minRowHeight;
private final DisplayMetrics metrics; private final DisplayMetrics metrics;
private final int background; private final int background;
private final int selectedColor; private final int selectedColor;
@ -51,14 +50,13 @@ public class ViewHolderFactory {
background = getResourceId(context, R.attr.selectableItemBackground); background = getResourceId(context, R.attr.selectableItemBackground);
selectedColor = getData(context, R.attr.colorControlHighlight); selectedColor = getData(context, R.attr.colorControlHighlight);
showFullTaskTitle = preferences.getBoolean(R.string.p_fullTaskTitle, false); showFullTaskTitle = preferences.getBoolean(R.string.p_fullTaskTitle, false);
fontSize = preferences.getIntegerFromString(R.string.p_fontSize, 18); fontSize = preferences.getIntegerFromString(R.string.p_fontSize, 16);
metrics = context.getResources().getDisplayMetrics(); metrics = context.getResources().getDisplayMetrics();
minRowHeight = (int) (metrics.density * 40);
} }
ViewHolder newViewHolder(ViewGroup viewGroup, ViewHolder.ViewHolderCallbacks callbacks, MultiSelector multiSelector) { ViewHolder newViewHolder(ViewGroup viewGroup, ViewHolder.ViewHolderCallbacks callbacks, MultiSelector multiSelector) {
return new ViewHolder(context, viewGroup, showFullTaskTitle, fontSize, checkBoxes, return new ViewHolder(context, viewGroup, showFullTaskTitle, fontSize, checkBoxes,
tagFormatter, textColorOverdue, textColorSecondary, textColorHint, taskDao, tagFormatter, textColorOverdue, textColorSecondary, textColorHint, taskDao,
dialogBuilder, callbacks, minRowHeight, metrics, background, selectedColor, multiSelector); dialogBuilder, callbacks, metrics, background, selectedColor, multiSelector);
} }
} }

@ -55,7 +55,8 @@ public class ThemeCache {
widgetThemes.add(new WidgetTheme( widgetThemes.add(new WidgetTheme(
widgetBackgroundNames[i], widgetBackgroundNames[i],
getColor(context, WidgetTheme.BACKGROUNDS[i]), getColor(context, WidgetTheme.BACKGROUNDS[i]),
getColor(context, i == 0 ? R.color.black_87 : R.color.white_100))); getColor(context, i == 0 ? R.color.black_87 : R.color.white_100),
getColor(context, i == 0 ? R.color.black_54 : R.color.white_70)));
} }
String []ledNames = resources.getStringArray(R.array.led); String []ledNames = resources.getStringArray(R.array.led);
for (int i = 0 ; i < LEDColor.LED_COLORS.length ; i++) { for (int i = 0 ; i < LEDColor.LED_COLORS.length ; i++) {

@ -10,20 +10,26 @@ public class WidgetTheme {
}; };
private final String name; private final String name;
private final int backgroundColor; private final int backgroundColor;
private final int textColor; private final int textColorPrimary;
private final int textColorSecondary;
public WidgetTheme(String name, int backgroundColor, int textColor) { public WidgetTheme(String name, int backgroundColor, int textColorPrimary, int textColorSecondary) {
this.name = name; this.name = name;
this.backgroundColor = backgroundColor; this.backgroundColor = backgroundColor;
this.textColor = textColor; this.textColorPrimary = textColorPrimary;
this.textColorSecondary = textColorSecondary;
} }
public int getBackgroundColor() { public int getBackgroundColor() {
return backgroundColor; return backgroundColor;
} }
public int getTextColor() { public int getTextColorPrimary() {
return textColor; return textColorPrimary;
}
public int getTextColorSecondary() {
return textColorSecondary;
} }
public String getName() { public String getName() {

@ -52,11 +52,12 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
private float textSize; private float textSize;
private float dueDateTextSize; private float dueDateTextSize;
private String filterId; private String filterId;
private int themeTextColor; private int textColorPrimary;
private int textColorSecondary;
private TodorooCursor<Task> cursor; private TodorooCursor<Task> cursor;
public ScrollableViewsFactory( ScrollableViewsFactory(
SubtasksHelper subtasksHelper, SubtasksHelper subtasksHelper,
Preferences preferences, Preferences preferences,
Context context, Context context,
@ -145,30 +146,30 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
return null; return null;
} }
String textContent; String textContent;
int textColor = themeTextColor; int textColorTitle = textColorPrimary;
textContent = task.getTitle(); textContent = task.getTitle();
RemoteViews row = new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.widget_row); RemoteViews row = new RemoteViews(BuildConfig.APPLICATION_ID, R.layout.widget_row);
if (task.isCompleted()) { if (task.isCompleted()) {
textColor = getColor(context, R.color.task_list_done); textColorTitle = textColorSecondary;
row.setInt(R.id.widget_text, "setPaintFlags", Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); row.setInt(R.id.widget_text, "setPaintFlags", Paint.STRIKE_THRU_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
} else { } else {
row.setInt(R.id.widget_text, "setPaintFlags", Paint.ANTI_ALIAS_FLAG); row.setInt(R.id.widget_text, "setPaintFlags", Paint.ANTI_ALIAS_FLAG);
} }
row.setFloat(R.id.widget_text, "setTextSize", textSize); row.setFloat(R.id.widget_text, "setTextSize", textSize);
if (showDueDates) { if (showDueDates) {
formatDueDate(row, task, textColor); formatDueDate(row, task);
} else { } else {
row.setViewVisibility(R.id.widget_due_date, View.GONE); row.setViewVisibility(R.id.widget_due_date, View.GONE);
if (task.hasDueDate() && task.isOverdue()) { if (task.hasDueDate() && task.isOverdue()) {
textColor = getColor(context, R.color.overdue); textColorTitle = getColor(context, R.color.overdue);
} }
} }
row.setTextViewText(R.id.widget_text, textContent); row.setTextViewText(R.id.widget_text, textContent);
row.setTextColor(R.id.widget_text, textColor); row.setTextColor(R.id.widget_text, textColorTitle);
row.setImageViewBitmap(R.id.widget_complete_box, getCheckbox(task)); row.setImageViewBitmap(R.id.widget_complete_box, getCheckbox(task));
long taskId = task.getId(); long taskId = task.getId();
@ -230,7 +231,7 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
return subtasksHelper.applySubtasksToWidgetFilter(filter, query); return subtasksHelper.applySubtasksToWidgetFilter(filter, query);
} }
private void formatDueDate(RemoteViews row, Task task, int textColor) { private void formatDueDate(RemoteViews row, Task task) {
if (task.hasDueDate()) { if (task.hasDueDate()) {
Resources resources = context.getResources(); Resources resources = context.getResources();
row.setViewVisibility(R.id.widget_due_date, View.VISIBLE); row.setViewVisibility(R.id.widget_due_date, View.VISIBLE);
@ -238,7 +239,7 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
? resources.getString(R.string.TAd_completed, DateUtilities.getRelativeDateStringWithTime(context, task.getCompletionDate())) ? resources.getString(R.string.TAd_completed, DateUtilities.getRelativeDateStringWithTime(context, task.getCompletionDate()))
: DateUtilities.getRelativeDateStringWithTime(context, task.getDueDate())); : DateUtilities.getRelativeDateStringWithTime(context, task.getDueDate()));
//noinspection ResourceAsColor //noinspection ResourceAsColor
row.setTextColor(R.id.widget_due_date, task.isOverdue() ? getColor(context, R.color.overdue) : textColor); row.setTextColor(R.id.widget_due_date, task.isOverdue() ? getColor(context, R.color.overdue) : textColorSecondary);
row.setFloat(R.id.widget_due_date, "setTextSize", dueDateTextSize); row.setFloat(R.id.widget_due_date, "setTextSize", dueDateTextSize);
} else { } else {
row.setViewVisibility(R.id.widget_due_date, View.GONE); row.setViewVisibility(R.id.widget_due_date, View.GONE);
@ -247,11 +248,12 @@ class ScrollableViewsFactory implements RemoteViewsService.RemoteViewsFactory {
private void updateSettings() { private void updateSettings() {
WidgetTheme widgetTheme = themeCache.getWidgetTheme(widgetPreferences.getThemeIndex()); WidgetTheme widgetTheme = themeCache.getWidgetTheme(widgetPreferences.getThemeIndex());
themeTextColor = widgetTheme.getTextColor(); textColorPrimary = widgetTheme.getTextColorPrimary();
textColorSecondary = widgetTheme.getTextColorSecondary();
showDueDates = widgetPreferences.showDueDate(); showDueDates = widgetPreferences.showDueDate();
showCheckboxes = widgetPreferences.showCheckboxes(); showCheckboxes = widgetPreferences.showCheckboxes();
textSize = widgetPreferences.getFontSize(); textSize = widgetPreferences.getFontSize();
dueDateTextSize = Math.max(10, textSize * 14 / 20); dueDateTextSize = Math.max(10, textSize - 2);
filterId = widgetPreferences.getFilterId(); filterId = widgetPreferences.getFilterId();
} }
} }

@ -1,123 +1,114 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rowBody" android:id="@+id/rowBody"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground" android:background="?attr/selectableItemBackground"
android:clickable="true" android:clickable="true"
android:focusable="true" android:focusable="true"
android:paddingBottom="5dp" android:orientation="vertical"
android:paddingTop="5dp"> android:paddingBottom="16dp"
android:paddingTop="16dp">
<com.todoroo.astrid.ui.CheckableImageView <!-- row 1 -->
android:id="@+id/completeBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center"
android:paddingEnd="@dimen/keyline_second"
android:paddingLeft="@dimen/keyline_first"
android:paddingRight="@dimen/keyline_second"
android:paddingStart="@dimen/keyline_first"
android:scaleType="center" />
<LinearLayout
android:id="@+id/task_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/completeBox"
android:layout_toRightOf="@id/completeBox"
android:gravity="center_vertical"
android:orientation="vertical">
<!-- row 1 --> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout <com.todoroo.astrid.ui.CheckableImageView
android:layout_width="match_parent" android:id="@+id/completeBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:paddingEnd="@dimen/keyline_second"
android:paddingLeft="@dimen/keyline_first"
android:paddingRight="@dimen/keyline_second"
android:paddingStart="@dimen/keyline_first"
android:scaleType="center" />
<TextView <ImageView
android:id="@+id/title" android:id="@+id/taskActionIcon"
android:layout_width="fill_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="100" android:layout_alignParentEnd="true"
android:ellipsize="end" android:layout_alignParentRight="true"
android:gravity="start|center_vertical" android:alpha="?attr/alpha_secondary"
android:maxLines="1" android:gravity="end|center_vertical"
android:paddingEnd="@dimen/keyline_first" android:paddingEnd="@dimen/keyline_first"
android:paddingLeft="0dp" android:paddingLeft="0dp"
android:paddingRight="@dimen/keyline_first" android:paddingRight="@dimen/keyline_first"
android:paddingStart="0dp" android:paddingStart="0dp"
android:singleLine="true" android:scaleType="center"
android:textAlignment="viewStart" android:tint="?attr/icon_tint" />
android:textColor="?android:attr/textColorPrimary" />
<LinearLayout <TextView
android:id="@+id/taskActionContainer" android:id="@+id/title"
android:layout_width="wrap_content" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_centerVertical="true"
android:gravity="end|center_vertical" android:layout_toEndOf="@id/completeBox"
android:orientation="vertical" android:layout_toLeftOf="@id/taskActionIcon"
android:paddingEnd="@dimen/keyline_first" android:layout_toRightOf="@id/completeBox"
android:paddingLeft="0dp" android:layout_toStartOf="@id/taskActionIcon"
android:paddingRight="@dimen/keyline_first" android:ellipsize="end"
android:paddingStart="0dp" android:gravity="start|center_vertical"
android:visibility="gone"> android:maxLines="1"
android:paddingEnd="@dimen/keyline_first"
android:paddingLeft="0dp"
android:paddingRight="@dimen/keyline_first"
android:paddingStart="0dp"
android:singleLine="true"
android:textAlignment="viewStart"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp" />
<ImageView </RelativeLayout>
android:id="@+id/taskActionIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:alpha="?attr/alpha_secondary"
android:scaleType="center"
android:tint="?attr/icon_tint" />
</LinearLayout>
</LinearLayout> <!-- row 2 -->
<!-- row 2 --> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingEnd="0dp"
android:paddingLeft="@dimen/keyline_content_inset"
android:paddingRight="0dp"
android:paddingStart="@dimen/keyline_content_inset">
<RelativeLayout <TextView
android:layout_width="match_parent" android:id="@+id/tag_block"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
<TextView android:ellipsize="none"
android:id="@+id/tag_block" android:maxLines="1"
android:layout_width="wrap_content" android:paddingEnd="@dimen/keyline_first"
android:layout_height="wrap_content" android:paddingLeft="0dp"
android:layout_alignParentEnd="true" android:paddingRight="@dimen/keyline_first"
android:layout_alignParentRight="true" android:paddingStart="0dp"
android:ellipsize="none" android:singleLine="true"
android:maxLines="1" android:textSize="14sp" />
android:paddingEnd="@dimen/keyline_first"
android:paddingLeft="0dp"
android:paddingRight="@dimen/keyline_first"
android:paddingStart="0dp"
android:singleLine="true" />
<TextView <TextView
android:id="@+id/due_date" android:id="@+id/due_date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignLeft="@id/tag_block" android:layout_alignLeft="@id/tag_block"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignStart="@id/tag_block" android:layout_alignStart="@id/tag_block"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingEnd="@dimen/keyline_first" android:paddingEnd="@dimen/keyline_first"
android:paddingLeft="0dp" android:paddingLeft="0dp"
android:paddingRight="@dimen/keyline_first" android:paddingRight="@dimen/keyline_first"
android:paddingStart="0dp" android:paddingStart="0dp"
android:singleLine="true" /> android:singleLine="true"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout> </RelativeLayout>
</RelativeLayout> </LinearLayout>

@ -92,10 +92,6 @@
<color name="led_purple">#800080</color> <color name="led_purple">#800080</color>
<color name="led_white">#ffffff</color> <color name="led_white">#ffffff</color>
<color name="overdue">@color/red_500</color>
<color name="task_list_done">#ff777777</color>
<color name="task_edit_deadline_gray">#888888</color>
<color name="black_87">#de000000</color> <color name="black_87">#de000000</color>
<color name="black_54">#8a000000</color> <color name="black_54">#8a000000</color>
<color name="black_38">#61000000</color> <color name="black_38">#61000000</color>
@ -106,6 +102,8 @@
<color name="white_50">#80ffffff</color> <color name="white_50">#80ffffff</color>
<color name="white_12">#1fffffff</color> <color name="white_12">#1fffffff</color>
<color name="overdue">@color/red_500</color>
<color name="md_background_dark">#303030</color> <color name="md_background_dark">#303030</color>
<color name="widget_background_black">#000000</color> <color name="widget_background_black">#000000</color>
<color name="icon_tint_light">@android:color/black</color> <color name="icon_tint_light">@android:color/black</color>

Loading…
Cancel
Save