Timer control bug fixes, some text color polish

pull/14/head
Sam Bosley 13 years ago
parent 233462a6dd
commit 467bc2651c

@ -68,12 +68,13 @@ public class TimerControlSet extends PopupControlSet implements TimerActionListe
int prefixResource, int titleResource) { int prefixResource, int titleResource) {
super(activity, -1); super(activity, -1);
this.property = property; this.property = property;
this.controlSet = new TimeDurationControlSet(activity, v, this.controlSet = new TimeDurationControlSet(activity, v, property,
timeButtonId, prefixResource, titleResource); timeButtonId, prefixResource, titleResource);
} }
@Override @Override
public void readFromTaskOnInitialize() { public void readFromTaskOnInitialize() {
controlSet.setModel(model);
controlSet.setTimeDuration(model.getValue(property)); controlSet.setTimeDuration(model.getValue(property));
} }

@ -9,5 +9,6 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:background="@drawable/footer_editbutton" android:background="@drawable/footer_editbutton"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@android:color/black"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:text="@string/DLG_ok"/> android:text="@string/DLG_ok"/>

@ -28,6 +28,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
style="?android:attr/textAppearanceLargeInverse" style="?android:attr/textAppearanceLargeInverse"
android:textColor="@android:color/black"
android:gravity="center" android:gravity="center"
android:inputType="phone" android:inputType="phone"
android:textSize="30sp" android:textSize="30sp"

@ -26,7 +26,9 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import com.timsu.astrid.R; import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.IntegerProperty;
import com.todoroo.andlib.service.DependencyInjectionService; import com.todoroo.andlib.service.DependencyInjectionService;
import com.todoroo.astrid.data.Task;
import com.todoroo.astrid.ui.NNumberPickerDialog.OnNNumberPickedListener; import com.todoroo.astrid.ui.NNumberPickerDialog.OnNNumberPickedListener;
@SuppressWarnings("nls") @SuppressWarnings("nls")
@ -40,19 +42,26 @@ public class TimeDurationControlSet implements OnNNumberPickedListener,
private int[] initialValues = null; private int[] initialValues = null;
private final int titleResource; private final int titleResource;
private NNumberPickerDialog dialog = null; private NNumberPickerDialog dialog = null;
private Task model;
private final IntegerProperty property;
public TimeDurationControlSet(Activity activity, View view, int timeButtonId, public TimeDurationControlSet(Activity activity, View view, IntegerProperty property,
int prefixResource, int titleResource) { int timeButtonId, int prefixResource, int titleResource) {
DependencyInjectionService.getInstance().inject(this); DependencyInjectionService.getInstance().inject(this);
this.activity = activity; this.activity = activity;
this.prefixResource = prefixResource; this.prefixResource = prefixResource;
this.titleResource = titleResource; this.titleResource = titleResource;
this.property = property;
timeButton = (Button)view.findViewById(timeButtonId); timeButton = (Button)view.findViewById(timeButtonId);
timeButton.setOnClickListener(this); timeButton.setOnClickListener(this);
} }
public void setModel(Task model) {
this.model = model;
}
public int getTimeDurationInSeconds() { public int getTimeDurationInSeconds() {
return timeDuration; return timeDuration;
} }
@ -76,6 +85,9 @@ public class TimeDurationControlSet implements OnNNumberPickedListener,
int hours = timeDuration / 3600; int hours = timeDuration / 3600;
int minutes = timeDuration / 60 - 60 * hours; int minutes = timeDuration / 60 - 60 * hours;
initialValues = new int[] { hours, minutes }; initialValues = new int[] { hours, minutes };
if (model != null)
model.setValue(property, timeDuration);
} }
/** Called when NumberPicker activity is completed */ /** Called when NumberPicker activity is completed */

Loading…
Cancel
Save