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

@ -263,12 +263,6 @@
<item>-1</item> <item>-1</item>
</string-array> </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) --> <!-- show task decorations (corresponds to showing notes icon in the task adapter) -->
<string name="p_default_showdecorations_key">p_show_decorations</string> <string name="p_default_showdecorations_key">p_show_decorations</string>

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

Loading…
Cancel
Save