New checkboxes, timer looks better, and tasks can show full title

pull/14/head
Andrew Shaw 14 years ago
parent 554690d3bb
commit 9a808fbb61

@ -141,7 +141,7 @@ public class EditNoteActivity extends LinearLayout implements TimerActionListene
private void setUpInterface() { private void setUpInterface() {
timerView = commentsBar.findViewById(R.id.timer_button); timerView = commentsBar.findViewById(R.id.timer_container);
commentButton = commentsBar.findViewById(R.id.commentButton); commentButton = commentsBar.findViewById(R.id.commentButton);
commentField = (EditText) commentsBar.findViewById(R.id.commentField); commentField = (EditText) commentsBar.findViewById(R.id.commentField);
commentField.setOnEditorActionListener(new OnEditorActionListener() { commentField.setOnEditorActionListener(new OnEditorActionListener() {

@ -8,7 +8,8 @@ import android.os.SystemClock;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.widget.Chronometer; import android.widget.Chronometer;
import android.widget.ImageButton; import android.widget.ImageView;
import android.widget.LinearLayout;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.andlib.utility.DateUtilities;
@ -17,20 +18,19 @@ import com.todoroo.astrid.helper.TaskEditControlSet;
public class TimerActionControlSet extends TaskEditControlSet { public class TimerActionControlSet extends TaskEditControlSet {
private final ImageButton timerButton; private final ImageView timerButton;
private final Chronometer chronometer; private final Chronometer chronometer;
private final LinearLayout timerContainer;
private boolean timerActive; private boolean timerActive;
private final Activity activity;
private Task task; private Task task;
private final List<TimerActionListener> listeners = new LinkedList<TimerActionListener>(); private final List<TimerActionListener> listeners = new LinkedList<TimerActionListener>();
public TimerActionControlSet(Activity activity, View parent) { public TimerActionControlSet(Activity activity, View parent) {
super(activity, -1); super(activity, -1);
this.activity = activity; timerContainer = (LinearLayout) parent.findViewById(R.id.timer_container);
timerButton = (ImageButton) parent.findViewById(R.id.timer_button); timerButton = (ImageView) parent.findViewById(R.id.timer_button);
timerButton.setOnClickListener(timerListener); timerContainer.setOnClickListener(timerListener);
chronometer = (Chronometer) parent.findViewById(R.id.timer);
chronometer = new Chronometer(activity);
} }
@Override @Override
@ -77,12 +77,9 @@ public class TimerActionControlSet extends TaskEditControlSet {
if(timerActive) { if(timerActive) {
drawable = R.drawable.icn_timer_stop; drawable = R.drawable.icn_timer_stop;
} else { } else {
if (task.getValue(Task.ELAPSED_SECONDS) == 0)
drawable = R.drawable.icn_edit_timer; drawable = R.drawable.icn_edit_timer;
else
drawable = R.drawable.icn_timer_start;
} }
timerButton.setBackgroundResource(drawable); timerButton.setImageResource(drawable);
long elapsed = task.getValue(Task.ELAPSED_SECONDS) * 1000L; long elapsed = task.getValue(Task.ELAPSED_SECONDS) * 1000L;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -1,55 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="100">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:gravity="center_vertical">
<RelativeLayout android:id="@+id/rowBody"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
> android:padding="10dip"
android:paddingRight="0dip"
android:orientation="horizontal" >
<!-- completion check-box --> <CheckBox
<CheckBox android:id="@+id/completeBox" android:id="@+id/completeBox"
android:layout_width="45dip" android:layout_width="45dip"
android:layout_height="45dip" android:layout_height="fill_parent"
android:layout_marginTop="4dip" android:gravity="center_vertical"
android:layout_marginLeft="3dip" android:button="@drawable/btn_check" />
android:layout_gravity="top"
android:button="@drawable/btn_check"/>
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100"
android:background="@drawable/edit_title_background">
<com.todoroo.astrid.ui.ErrorCatchingEditText <com.todoroo.astrid.ui.ErrorCatchingEditText
android:id="@+id/title" android:id="@+id/title"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="100" android:layout_weight="100"
android:hint="@string/TEA_title_hint"
android:autoText="true" android:autoText="true"
android:paddingTop="10dip" android:background="@drawable/edit_title_background"
android:paddingLeft="10dip" android:capitalize="sentences"
android:scrollbars="vertical" android:freezesText="true"
android:hint="@string/TEA_title_hint"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:paddingLeft="5dip"
android:paddingTop="3dip"
android:scrollbars="vertical"
android:text="" android:text=""
android:background="@android:color/transparent" android:textColor="@android:color/black" />
android:capitalize="sentences"
android:freezesText="true"/>
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>

@ -6,30 +6,32 @@
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:paddingBottom="4dip" > android:minHeight="70dip"
android:layout_marginTop="20dip"
android:paddingBottom="20dip" >
<!-- completion check-box --> <!-- completion check-box -->
<greendroid.widget.AsyncImageView <greendroid.widget.AsyncImageView
android:id="@+id/picture" android:id="@+id/picture"
android:layout_width="35dip" android:layout_width="47dip"
android:layout_height="35dip" android:layout_height="45dip"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:padding="2dip" android:padding="2dip"
android:layout_marginLeft="9dip" android:layout_marginLeft="5dip"
astrid:defaultSrc="@drawable/icn_default_person_image" astrid:defaultSrc="@drawable/icn_default_person_image"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:visibility="gone" > android:visibility="gone" >
</greendroid.widget.AsyncImageView> </greendroid.widget.AsyncImageView>
<ImageView <ImageView
android:id="@+id/pictureBorder" android:id="@+id/pictureBorder"
android:layout_width="50dip" android:layout_width="47dip"
android:layout_height="44dip" android:layout_height="47dip"
android:layout_marginLeft="6dip" android:layout_marginLeft="5dip"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:background="@drawable/icn_default_person_image" android:background="@drawable/icn_default_person_image"
android:scaleType="fitCenter" android:scaleType="center"
android:visibility="gone" > android:visibility="gone" >
</ImageView> </ImageView>
@ -38,18 +40,19 @@
<CheckBox <CheckBox
android:id="@+id/completeBox" android:id="@+id/completeBox"
android:layout_width="45dip" android:layout_width="45dip"
android:layout_marginLeft="13dip"
android:layout_height="fill_parent" android:layout_height="fill_parent"
android:scaleType="fitCenter" android:minHeight="40dip"
android:layout_alignParentTop="true" android:scaleType="center"
android:layout_marginLeft="12dip" /> android:layout_centerVertical="true" />
<!-- assignee photo --> <!-- assignee photo -->
<LinearLayout <LinearLayout
android:id="@+id/task_row" android:id="@+id/task_row"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:layout_alignTop="@id/completeBox" android:layout_centerVertical="true"
android:layout_toRightOf="@id/completeBox" android:layout_toRightOf="@id/completeBox"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="2dip" > android:paddingLeft="2dip" >
@ -60,7 +63,7 @@
android:id="@+id/title" android:id="@+id/title"
style="@style/TextAppearance.TAd_ItemTitle" style="@style/TextAppearance.TAd_ItemTitle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:layout_weight="100" android:layout_weight="100"
android:gravity="center_vertical" android:gravity="center_vertical"
android:maxLines="2" /> android:maxLines="2" />

@ -160,23 +160,42 @@
<!-- Extended Add Button --> <!-- Extended Add Button -->
<ImageButton <LinearLayout
android:id="@+id/timer_container"
android:layout_width="39dip"
android:layout_height="39dip"
android:layout_marginLeft="2dip"
android:layout_weight="1"
android:orientation="vertical" >
<ImageView
android:id="@+id/timer_button" android:id="@+id/timer_button"
android:layout_width="35dip" android:layout_width="fill_parent"
android:layout_height="35dip" android:layout_height="25dip"
android:layout_marginLeft="3dip" android:layout_weight="1"
android:layout_marginTop="3dip" android:background="#00000000"
android:padding="7dip" android:gravity="center_vertical|center_horizontal"
android:scaleType="fitCenter" android:paddingRight="5dip"
android:layout_weight="1"/> android:paddingLeft="5dip"
android:scaleType="centerInside" />
<Chronometer
android:id="@+id/timer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center_horizontal"
android:textColor="@color/task_edit_details"
android:textSize="10sp"
android:visibility="visible" />
</LinearLayout>
<ImageButton <ImageButton
android:id="@+id/commentButton" android:id="@+id/commentButton"
android:layout_width="39dip" android:layout_width="39dip"
android:layout_height="39dip" android:layout_height="39dip"
android:layout_gravity="top" android:layout_gravity="top"
android:layout_marginRight="3dip" android:layout_marginLeft="3dip"
android:layout_weight="1" android:layout_weight="1"
android:background="?attr/asAddButtonImg" android:background="?attr/asAddButtonImg"
android:scaleType="center" android:scaleType="center"

@ -266,6 +266,9 @@
<!-- show task details (corresponds to showing repeat and tag details in the task adapter) --> <!-- show task details (corresponds to showing repeat and tag details in the task adapter) -->
<string name="p_default_showdetails_key">p_show_details</string> <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>

@ -266,6 +266,14 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
viewHolder.details2 = (TextView)view.findViewById(R.id.details2); viewHolder.details2 = (TextView)view.findViewById(R.id.details2);
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)) {
viewHolder.nameView.setMaxLines(Integer.MAX_VALUE);
LayoutParams containerParams = view.getLayoutParams();
containerParams.height = LayoutParams.WRAP_CONTENT;
view.setLayoutParams(containerParams);
}
view.setTag(viewHolder); view.setTag(viewHolder);
for(int i = 0; i < view.getChildCount(); i++) for(int i = 0; i < view.getChildCount(); i++)
view.getChildAt(i).setTag(viewHolder); view.getChildAt(i).setTag(viewHolder);
@ -330,6 +338,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
// name // name
final TextView nameView = viewHolder.nameView; { final TextView nameView = viewHolder.nameView; {
String nameValue = task.getValue(Task.TITLE); String nameValue = task.getValue(Task.TITLE);
long hiddenUntil = task.getValue(Task.HIDE_UNTIL); long hiddenUntil = task.getValue(Task.HIDE_UNTIL);
if(task.getValue(Task.DELETION_DATE) > 0) if(task.getValue(Task.DELETION_DATE) > 0)
nameValue = r.getString(R.string.TAd_deletedFormat, nameValue); nameValue = r.getString(R.string.TAd_deletedFormat, nameValue);
@ -404,7 +413,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
} }
if (pictureView.getVisibility() == View.VISIBLE) { if (pictureView.getVisibility() == View.VISIBLE) {
checkBoxView.setVisibility(View.INVISIBLE); checkBoxView.setVisibility(View.INVISIBLE);
viewHolder.pictureBorder.setBackgroundResource(IMPORTANCE_RESOURCES[value]); viewHolder.pictureBorder.setBackgroundResource(IMPORTANCE_RESOURCES_LARGE[value]);
} else { } else {
checkBoxView.setVisibility(View.VISIBLE); checkBoxView.setVisibility(View.VISIBLE);
} }

Loading…
Cancel
Save