aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-13 14:52:12 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-13 14:52:12 -0700
commitff5e91853f50349706943bf4f80431bd1d0cab37 (patch)
tree6095443bb7713d3e4a0058404a6780d0acc5a4b1 /src/github/daneren2005
parent08a434690ee25320a256242ee9c9f34926ece4f9 (diff)
downloaddsub-ff5e91853f50349706943bf4f80431bd1d0cab37.tar.gz
dsub-ff5e91853f50349706943bf4f80431bd1d0cab37.tar.bz2
dsub-ff5e91853f50349706943bf4f80431bd1d0cab37.zip
#386 Start of adding ability to toggle offline from Tasker
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/activity/EditPlayActionActivity.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java b/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
index b7f9de94..c59b679f 100644
--- a/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
+++ b/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
@@ -22,13 +22,16 @@ import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import android.widget.ArrayAdapter;
import android.widget.CheckBox;
+import android.widget.Spinner;
import github.daneren2005.dsub.R;
import github.daneren2005.dsub.util.Constants;
public class EditPlayActionActivity extends SubsonicActivity {
- private CheckBox checkBox;
+ private CheckBox shuffleCheckbox;
+ private Spinner offlineSpinner;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -36,11 +39,16 @@ public class EditPlayActionActivity extends SubsonicActivity {
setTitle(R.string.tasker_start_playing_title);
setContentView(R.layout.edit_play_action);
- checkBox = (CheckBox) findViewById(R.id.edit_shuffle_checkbox);
+ shuffleCheckbox = (CheckBox) findViewById(R.id.edit_shuffle_checkbox);
if(getIntent().getBundleExtra(Constants.TASKER_EXTRA_BUNDLE) != null && getIntent().getBundleExtra(Constants.TASKER_EXTRA_BUNDLE).getBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE)) {
- checkBox.setChecked(true);
+ shuffleCheckbox.setChecked(true);
}
+ offlineSpinner = (Spinner) findViewById(R.id.edit_offline_spinner);
+ ArrayAdapter<CharSequence> offlineAdapter = ArrayAdapter.createFromResource(this, R.array.editServerOptions, android.R.layout.simple_spinner_item);
+ offlineAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ offlineSpinner.setAdapter(offlineAdapter);
+
drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
}
@@ -70,11 +78,11 @@ public class EditPlayActionActivity extends SubsonicActivity {
private void accept() {
Intent intent = new Intent();
- String blurb = getResources().getString(checkBox.isChecked() ? R.string.tasker_start_playing_shuffled : R.string.tasker_start_playing);
+ String blurb = getResources().getString(shuffleCheckbox.isChecked() ? R.string.tasker_start_playing_shuffled : R.string.tasker_start_playing);
intent.putExtra("com.twofortyfouram.locale.intent.extra.BLURB", blurb);
Bundle data = new Bundle();
- data.putBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, checkBox.isChecked());
+ data.putBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, shuffleCheckbox.isChecked());
intent.putExtra(Constants.TASKER_EXTRA_BUNDLE, data);
setResult(Activity.RESULT_OK, intent);