diff options
author | lado <herrlado@gmail.com> | 2011-10-20 03:57:54 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-20 03:57:54 +0200 |
commit | 344d581f0ab5ece5f8605312dfadb3f7f809ce94 (patch) | |
tree | 6c6fde0f55679ada1d431bbfa7e10f131a5f146c /vdrmanager/src/de/bjusystems | |
parent | 50de0cc928335047c0ca080fda9cbdc18504f6f3 (diff) | |
download | vdr-manager-344d581f0ab5ece5f8605312dfadb3f7f809ce94.tar.gz vdr-manager-344d581f0ab5ece5f8605312dfadb3f7f809ce94.tar.bz2 |
now all timer operations via TimerTasks
Diffstat (limited to 'vdrmanager/src/de/bjusystems')
4 files changed, 46 insertions, 2 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/CreateTimerTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/CreateTimerTask.java new file mode 100644 index 0000000..f9ab94b --- /dev/null +++ b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/CreateTimerTask.java @@ -0,0 +1,19 @@ +package de.bjusystems.vdrmanager.tasks; + +import android.app.Activity; +import de.bjusystems.vdrmanager.R; +import de.bjusystems.vdrmanager.data.Timer; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient.TimerOperation; + +public abstract class CreateTimerTask extends AsyncProgressTask<Timer> { + + public CreateTimerTask(final Activity activity, final Timer timer) { + super(activity, new SetTimerClient(timer, TimerOperation.CREATE) { + @Override + public int getProgressTextId() { + return R.string.progress_timer_save; + } + }); + } +} diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/DeleteTimerTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/DeleteTimerTask.java index 48cdd23..f4ea149 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/DeleteTimerTask.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/DeleteTimerTask.java @@ -4,11 +4,12 @@ import android.app.Activity; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Timer; import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient.TimerOperation; public abstract class DeleteTimerTask extends AsyncProgressTask<Timer> { public DeleteTimerTask(final Activity activity, final Timer timer) { - super(activity, new SetTimerClient(timer, true) { + super(activity, new SetTimerClient(timer, TimerOperation.DELETE) { @Override public int getProgressTextId() { return R.string.progress_timer_delete; diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ModifyTimerTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ModifyTimerTask.java new file mode 100644 index 0000000..57fba6e --- /dev/null +++ b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ModifyTimerTask.java @@ -0,0 +1,23 @@ +package de.bjusystems.vdrmanager.tasks; + +import android.app.Activity; +import de.bjusystems.vdrmanager.R; +import de.bjusystems.vdrmanager.data.Timer; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient.TimerOperation; + +public abstract class ModifyTimerTask extends AsyncProgressTask<Timer> { + + public ModifyTimerTask(final Activity activity, final Timer timer) { + super(activity, new SetTimerClient(timer, TimerOperation.MODIFY) { + @Override + public int getProgressTextId() { + return R.string.progress_timer_modify; + } + + + }); + + + } +} diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ToggleTimerTask.java b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ToggleTimerTask.java index ee146e5..a3b5d6a 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ToggleTimerTask.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/tasks/ToggleTimerTask.java @@ -4,11 +4,12 @@ import android.app.Activity; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Timer; import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient; +import de.bjusystems.vdrmanager.utils.svdrp.SetTimerClient.TimerOperation; public abstract class ToggleTimerTask extends AsyncProgressTask<Timer> { public ToggleTimerTask(final Activity activity, final Timer timer) { - super(activity, new SetTimerClient(timer, false) { + super(activity, new SetTimerClient(timer, TimerOperation.MODIFY) { boolean enabled = timer.isEnabled(); @Override |