Timer control bug fixes, some text color polish

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

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

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

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

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

Loading…
Cancel
Save