Preferences for showing notes

pull/14/head
Andrew Shaw 13 years ago
parent acc6683ea4
commit 11a552b198

@ -6,8 +6,7 @@
android:id="@+id/rowBody"
android:layout_width="fill_parent"
android:layout_height="70dip"
android:minHeight="70dip"
android:layout_marginTop="20dip" >
android:minHeight="70dip" >
<!-- completion check-box -->
@ -51,8 +50,8 @@
android:id="@+id/task_row"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/completeBox"
android:layout_centerVertical="true"
android:orientation="horizontal"
android:paddingLeft="2dip" >
@ -87,8 +86,6 @@
android:layout_height="wrap_content"
android:layout_alignLeft="@id/task_row"
android:layout_below="@id/task_row"
android:layout_marginLeft="5dip"
android:layout_marginTop="-5dip"
android:visibility="gone" />
<!-- details line 2 -->

@ -202,4 +202,4 @@
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -263,12 +263,6 @@
<item>-1</item>
</string-array>
<!-- show task details (corresponds to showing repeat and tag details in the task adapter) -->
<string name="p_default_showdetails_key">p_show_details</string>
<!-- show full task title (corresponds to showing full task title in task adapter) -->
<string name="p_default_showfulltitle_key">p_show_full_title</string>
<!-- show task decorations (corresponds to showing notes icon in the task adapter) -->
<string name="p_default_showdecorations_key">p_show_decorations</string>

@ -212,7 +212,8 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
displayMetrics = new DisplayMetrics();
fragment.getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
if (Preferences.getBoolean(R.string.p_default_showdetails_key, false)) {
if (Preferences.getBoolean(R.string.p_showNotes, false)) {
detailLoader = new DetailLoaderThread();
detailLoader.start();
}
@ -267,11 +268,15 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
viewHolder.taskRow = (LinearLayout)view.findViewById(R.id.task_row);
if (Preferences.getBoolean(R.string.p_default_showfulltitle_key, false)) {
if (Preferences.getBoolean(R.string.p_showNotes, false)) {
viewHolder.nameView.setMaxLines(Integer.MAX_VALUE);
LayoutParams containerParams = view.getLayoutParams();
containerParams.height = LayoutParams.WRAP_CONTENT;
view.setPadding(view.getPaddingLeft(), 20, view.getPaddingRight(), 20);
view.setLayoutParams(containerParams);
RelativeLayout.LayoutParams taskRowParams = (RelativeLayout.LayoutParams)viewHolder.taskRow.getLayoutParams();
taskRowParams.addRule(RelativeLayout.CENTER_VERTICAL, 0);
}
view.setTag(viewHolder);
@ -428,7 +433,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
if(TextUtils.isEmpty(details) || DETAIL_SEPARATOR.equals(details) || task.isCompleted()) {
viewHolder.details1.setVisibility(View.GONE);
viewHolder.details2.setVisibility(View.GONE);
} else if (Preferences.getBoolean(R.string.p_default_showdetails_key, false)) {
} else if (Preferences.getBoolean(R.string.p_showNotes, false)) {
viewHolder.details1.setVisibility(View.VISIBLE);
if (details.startsWith(DETAIL_SEPARATOR)) {
StringBuffer buffer = new StringBuffer(details);

Loading…
Cancel
Save