Added preference to compress task rows to fit title

pull/14/head
Sam Bosley 13 years ago
parent 7a639b1217
commit 7f63206531

@ -200,6 +200,7 @@
<string name="p_showSmartConfirmation_key">showSmartConfirmation</string> <string name="p_showSmartConfirmation_key">showSmartConfirmation</string>
<string name="p_allowCompressedTaskRows">allowCompressedTaskRows</string>
<!-- ========================================================= DEFAULTS == --> <!-- ========================================================= DEFAULTS == -->
<!-- default urgency setting (corresponds to entry in TEA_urgency) --> <!-- default urgency setting (corresponds to entry in TEA_urgency) -->

@ -477,6 +477,10 @@
<!-- Preference: Task List Show Notes Description (enabled) --> <!-- Preference: Task List Show Notes Description (enabled) -->
<string name="EPr_showNotes_desc_enabled">Notes will always be displayed</string> <string name="EPr_showNotes_desc_enabled">Notes will always be displayed</string>
<!-- Preferences: Allow task rows to compress to size of task -->
<string name="EPr_compressTaskRows_title">Compact Task Row</string>
<string name="EPr_compressTaskRows_desc">Compress task rows to fit title</string>
<!-- Preference: Theme --> <!-- Preference: Theme -->
<string name="EPr_theme_title">Color Theme</string> <string name="EPr_theme_title">Color Theme</string>
<!-- Preference: Theme Description (%s => value) --> <!-- Preference: Theme Description (%s => value) -->

@ -22,6 +22,12 @@
android:title="@string/EPr_showNotes_title" android:title="@string/EPr_showNotes_title"
android:defaultValue="false" /> android:defaultValue="false" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_allowCompressedTaskRows"
android:title="@string/EPr_compressTaskRows_title"
android:summary="@string/EPr_compressTaskRows_desc"
android:defaultValue="false" />
<com.todoroo.astrid.ui.MultilineCheckboxPreference <com.todoroo.astrid.ui.MultilineCheckboxPreference
android:key="@string/p_showSmartConfirmation_key" android:key="@string/p_showSmartConfirmation_key"
android:title="@string/EPr_showSmartConfirmation_title" android:title="@string/EPr_showSmartConfirmation_title"

@ -169,6 +169,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private final AtomicReference<String> query; private final AtomicReference<String> query;
private final int minRowHeight;
// quick action bar // quick action bar
private QuickActionWidget mBar; private QuickActionWidget mBar;
private final QuickActionListener mBarListener = new QuickActionListener(); private final QuickActionListener mBarListener = new QuickActionListener();
@ -214,6 +216,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
displayMetrics = new DisplayMetrics(); displayMetrics = new DisplayMetrics();
fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
this.minRowHeight = (int) (57 * displayMetrics.density);
if (Preferences.getBoolean(R.string.p_showNotes, false)) { if (Preferences.getBoolean(R.string.p_showNotes, false)) {
detailLoader = new DetailLoaderThread(); detailLoader = new DetailLoaderThread();
@ -342,6 +345,12 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
ViewHolder viewHolder = (ViewHolder)view.getTag(); ViewHolder viewHolder = (ViewHolder)view.getTag();
Task task = viewHolder.task; Task task = viewHolder.task;
if (Preferences.getBoolean(R.string.p_allowCompressedTaskRows, false)) {
viewHolder.rowBody.setMinimumHeight(0);
} else {
viewHolder.rowBody.setMinimumHeight(minRowHeight);
}
// name // name
final TextView nameView = viewHolder.nameView; { final TextView nameView = viewHolder.nameView; {
String nameValue = task.getValue(Task.TITLE); String nameValue = task.getValue(Task.TITLE);

Loading…
Cancel
Save