diff --git a/astrid/res/layout/task_adapter_row_simple.xml b/astrid/res/layout/task_adapter_row_simple.xml index fb47cb59f..c6ff24037 100644 --- a/astrid/res/layout/task_adapter_row_simple.xml +++ b/astrid/res/layout/task_adapter_row_simple.xml @@ -106,6 +106,7 @@ android:id="@+id/taskActionContainer" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="5dip" android:layout_marginRight="10dip" android:orientation="vertical" android:gravity="right|center_vertical"> diff --git a/astrid/res/values/keys.xml b/astrid/res/values/keys.xml index d1d91c438..4ce230cd9 100644 --- a/astrid/res/values/keys.xml +++ b/astrid/res/values/keys.xml @@ -197,6 +197,7 @@ colorize font_size + p_taskRowStyle notesVisible beastMode transparent diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index c37d5aa86..b82cdadb6 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -640,6 +640,12 @@ Web searches for Ideas tab will be performed when tab is clicked Web searches for Ideas tab will be performed only when manually requested + + Row Style: Simple + Row Style: Original + Truncate title to one line with date and lists below + Truncate title to two lines with date on right + Color Theme diff --git a/astrid/res/xml/preferences.xml b/astrid/res/xml/preferences.xml index 7bb219e2c..26158635d 100644 --- a/astrid/res/xml/preferences.xml +++ b/astrid/res/xml/preferences.xml @@ -37,6 +37,10 @@ android:title="@string/EPr_fontSize_title" android:summary="@string/EPr_fontSize_desc" /> + + cursor) { - return new TaskAdapter(this, R.layout.task_adapter_row_simple, + int resource = Preferences.getBoolean(R.string.p_taskRowStyle, false) ? + R.layout.task_adapter_row_simple : R.layout.task_adapter_row; + + return new TaskAdapter(this, resource, cursor, sqlQueryTemplate, false, new OnCompletedTaskListener() { @Override diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 0a097b445..9fda4c8f5 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -116,7 +116,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable { Metadata.ID.name).as("taskRabId"); //$NON-NLS-1$ @SuppressWarnings("nls") - private static final StringProperty TAGS = new StringProperty(null, "group_concat(" + TaskListFragment.TAGS_METADATA_JOIN + "." + TagService.TAG.name + ", ' | ')").as("tags"); + private static final StringProperty TAGS = new StringProperty(null, "group_concat(" + TaskListFragment.TAGS_METADATA_JOIN + "." + TagService.TAG.name + ", ' | ')").as("tags"); // --- other constants @@ -1046,15 +1046,21 @@ public class TaskAdapter extends CursorAdapter implements Filterable { name.setTextAppearance(activity, R.style.TextAppearance_TAd_ItemTitle); } name.setTextSize(fontSize); - float detailTextSize = Math.max(10, fontSize * 12 / 20); + float detailTextSize = Math.max(10, fontSize * 14 / 20); if(viewHolder.details1 != null) viewHolder.details1.setTextSize(detailTextSize); if(viewHolder.details2 != null) viewHolder.details2.setTextSize(detailTextSize); - if(viewHolder.dueDate != null) + if(viewHolder.dueDate != null) { viewHolder.dueDate.setTextSize(detailTextSize); - if (viewHolder.tagsView != null) + if (simpleLayout) + viewHolder.dueDate.setTypeface(null, 0); + } + if (viewHolder.tagsView != null) { viewHolder.tagsView.setTextSize(detailTextSize); + if (simpleLayout) + viewHolder.tagsView.setTypeface(null, 0); + } paint.setTextSize(detailTextSize); // image view @@ -1155,7 +1161,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable { if (viewHolder.tagsView != null) { String tags = viewHolder.tagsString; if (tags != null && task.hasDueDate()) - tags = " | " + tags; //$NON-NLS-1$ + tags = " | " + tags; //$NON-NLS-1$ if (!task.isCompleted()) viewHolder.tagsView.setText(tags); else diff --git a/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java b/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java index 3fe60ca13..2f7305362 100644 --- a/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java +++ b/astrid/src/com/todoroo/astrid/service/abtesting/ABTests.java @@ -123,10 +123,15 @@ public class ABTests { public static final String AB_SWIPE_BETWEEN = "android_swipe_v3"; //$NON-NLS-1$ + public static final String AB_SIMPLE_TASK_ROW = "android_simple_task_row"; //$NON-NLS-1$ + private void initialize() { addTest(AB_TASK_EDIT_TOAST, new int[] { 1, 1 }, new int[] { 1, 1 }, new String[] { "dont-show-toasts", "show-toasts" }); //$NON-NLS-1$ //$NON-NLS-2$ + addTest(AB_SIMPLE_TASK_ROW, new int[] { 1, 1 }, + new int[] { 1, 0 }, new String[] { "original-row-style", "simple-row-style" });//$NON-NLS-1$ //$NON-NLS-2$ + // AB_SWIPE_BETWEEN has to be added in the startup service since it needs a non-null context for initialization } } diff --git a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java index de7666c00..3decf017d 100644 --- a/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java +++ b/astrid/src/com/todoroo/astrid/utility/AstridPreferences.java @@ -74,6 +74,9 @@ public class AstridPreferences { Preferences.setIfUnset(prefs, editor, r, R.string.p_showEditToasts, ABChooser.readChoiceForTest(ABTests.AB_TASK_EDIT_TOAST) != 0); + Preferences.setIfUnset(prefs, editor, r, R.string.p_taskRowStyle, + ABChooser.readChoiceForTest(ABTests.AB_SIMPLE_TASK_ROW) != 0); + boolean swipeEnabled = false; String swipePerformanceKey = context.getString(R.string.p_swipe_lists_performance_key); if (Preferences.isSet(swipePerformanceKey)) {