Fixed bugs from refactor with timer controls

pull/14/head
Sam Bosley 13 years ago
parent 1938b179f4
commit 07d763f62d

@ -92,7 +92,7 @@ public class TimerActionControlSet extends TaskEditControlSet {
chronometer.setVisibility(View.VISIBLE);
elapsed += DateUtilities.now() - model.getValue(Task.TIMER_START);
chronometer.setBase(SystemClock.elapsedRealtime() - elapsed);
if (elapsed > DateUtilities.ONE_DAY); {
if (elapsed > DateUtilities.ONE_DAY) {
chronometer.setOnChronometerTickListener(new OnChronometerTickListener() {
public void onChronometerTick(Chronometer cArg) {
long t = SystemClock.elapsedRealtime() - cArg.getBase();

@ -25,25 +25,23 @@ public class TimerControlSet extends PopupControlSet implements TimerActionListe
super(activity, viewLayout, displayViewLayout, title);
this.displayText.setText(activity.getString(R.string.TEA_timer_controls));
estimated = new TimeDurationTaskEditControlSet(activity, getView(), Task.ESTIMATED_SECONDS,
R.id.estimatedDuration, 0, R.string.DLG_hour_minutes
);
elapsed = new TimeDurationTaskEditControlSet(activity, getView(), Task.ELAPSED_SECONDS, R.id.elapsedDuration,
0, R.string.DLG_hour_minutes
);
}
@Override
protected void readFromTaskOnInitialize() {
estimated.readFromTask(model);
estimated.getView(); // force load
elapsed.readFromTask(model);
elapsed.getView(); // force load
}
@Override
protected void afterInflate() {
estimated = new TimeDurationTaskEditControlSet(activity, getView(), Task.ESTIMATED_SECONDS,
R.id.estimatedDuration, 0, R.string.DLG_hour_minutes
);
elapsed = new TimeDurationTaskEditControlSet(activity, getView(), Task.ELAPSED_SECONDS, R.id.elapsedDuration,
0, R.string.DLG_hour_minutes
);
// Nothing to do here
}
@Override

@ -22,6 +22,8 @@ public abstract class TaskEditControlSet {
public TaskEditControlSet(Activity activity, int viewLayout) {
this.activity = activity;
this.viewLayout = viewLayout;
if (viewLayout == -1)
initialized = true;
}
public View getView() {

Loading…
Cancel
Save