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() {
timerView = commentsBar.findViewById(R.id.timer_button);
timerView = commentsBar.findViewById(R.id.timer_container);
commentButton = commentsBar.findViewById(R.id.commentButton);
commentField = (EditText) commentsBar.findViewById(R.id.commentField);
commentField.setOnEditorActionListener(new OnEditorActionListener() {

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

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"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:padding="10dip"
android:paddingRight="0dip"
android:orientation="horizontal" >
<!-- completion check-box -->
<CheckBox android:id="@+id/completeBox"
<CheckBox
android:id="@+id/completeBox"
android:layout_width="45dip"
android:layout_height="45dip"
android:layout_marginTop="4dip"
android:layout_marginLeft="3dip"
android:layout_gravity="top"
android:button="@drawable/btn_check"/>
android:layout_height="fill_parent"
android:gravity="center_vertical"
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
android:id="@+id/title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100"
android:hint="@string/TEA_title_hint"
android:autoText="true"
android:paddingTop="10dip"
android:paddingLeft="10dip"
android:scrollbars="vertical"
android:background="@drawable/edit_title_background"
android:capitalize="sentences"
android:freezesText="true"
android:hint="@string/TEA_title_hint"
android:inputType="textMultiLine"
android:paddingLeft="5dip"
android:paddingTop="3dip"
android:scrollbars="vertical"
android:text=""
android:background="@android:color/transparent"
android:capitalize="sentences"
android:freezesText="true"/>
</LinearLayout>
android:textColor="@android:color/black" />
</LinearLayout>
</LinearLayout>

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

@ -160,23 +160,42 @@
<!-- 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:layout_width="35dip"
android:layout_height="35dip"
android:layout_marginLeft="3dip"
android:layout_marginTop="3dip"
android:padding="7dip"
android:scaleType="fitCenter"
android:layout_weight="1"/>
android:layout_width="fill_parent"
android:layout_height="25dip"
android:layout_weight="1"
android:background="#00000000"
android:gravity="center_vertical|center_horizontal"
android:paddingRight="5dip"
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
android:id="@+id/commentButton"
android:layout_width="39dip"
android:layout_height="39dip"
android:layout_gravity="top"
android:layout_marginRight="3dip"
android:layout_marginLeft="3dip"
android:layout_weight="1"
android:background="?attr/asAddButtonImg"
android:scaleType="center"

@ -266,6 +266,9 @@
<!-- 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>

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

Loading…
Cancel
Save