|
|
@ -200,6 +200,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
protected final DisplayMetrics displayMetrics;
|
|
|
|
protected final DisplayMetrics displayMetrics;
|
|
|
|
|
|
|
|
|
|
|
|
private final boolean simpleLayout;
|
|
|
|
private final boolean simpleLayout;
|
|
|
|
|
|
|
|
protected final int minRowHeight;
|
|
|
|
|
|
|
|
|
|
|
|
// --- task detail and decoration soft caches
|
|
|
|
// --- task detail and decoration soft caches
|
|
|
|
|
|
|
|
|
|
|
@ -239,6 +240,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
|
|
|
fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
|
|
|
|
|
|
|
|
|
|
|
|
this.simpleLayout = (resource == R.layout.task_adapter_row_simple);
|
|
|
|
this.simpleLayout = (resource == R.layout.task_adapter_row_simple);
|
|
|
|
|
|
|
|
this.minRowHeight = computeMinRowHeight();
|
|
|
|
|
|
|
|
|
|
|
|
startDetailThread();
|
|
|
|
startDetailThread();
|
|
|
|
startTaskActionsThread();
|
|
|
|
startTaskActionsThread();
|
|
|
@ -251,6 +253,15 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private int computeMinRowHeight() {
|
|
|
|
|
|
|
|
DisplayMetrics metrics = resources.getDisplayMetrics();
|
|
|
|
|
|
|
|
if (simpleLayout) {
|
|
|
|
|
|
|
|
return (int) (metrics.density * 40);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return (int) (metrics.density * 45);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void startDetailThread() {
|
|
|
|
private void startDetailThread() {
|
|
|
|
if (Preferences.getBoolean(R.string.p_showNotes, false) && !simpleLayout) {
|
|
|
|
if (Preferences.getBoolean(R.string.p_showNotes, false) && !simpleLayout) {
|
|
|
|
detailLoader = new DetailLoaderThread();
|
|
|
|
detailLoader = new DetailLoaderThread();
|
|
|
@ -382,6 +393,13 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
|
|
|
|
public synchronized void setFieldContentsAndVisibility(View view) {
|
|
|
|
public synchronized void setFieldContentsAndVisibility(View view) {
|
|
|
|
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);
|
|
|
|
|
|
|
|
viewHolder.completeBox.setMinimumHeight(0);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
viewHolder.rowBody.setMinimumHeight(minRowHeight);
|
|
|
|
|
|
|
|
viewHolder.completeBox.setMinimumHeight(minRowHeight);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// name
|
|
|
|
// name
|
|
|
|
final TextView nameView = viewHolder.nameView; {
|
|
|
|
final TextView nameView = viewHolder.nameView; {
|
|
|
|