aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-10-17 14:50:23 -0700
committerScott Jackson <daneren2005@gmail.com>2014-10-17 14:50:23 -0700
commit1059cdbc0d7e65130efbc49f9fb4f3f90fe84efe (patch)
treed12d38c67a325b41cd037500bb28480b3c37144c
parent6802f91bfea4d378c8e27690430a86e1d7efb503 (diff)
downloaddsub-1059cdbc0d7e65130efbc49f9fb4f3f90fe84efe.tar.gz
dsub-1059cdbc0d7e65130efbc49f9fb4f3f90fe84efe.tar.bz2
dsub-1059cdbc0d7e65130efbc49f9fb4f3f90fe84efe.zip
#386 Save Tasker options on accept()
-rw-r--r--src/github/daneren2005/dsub/activity/EditPlayActionActivity.java26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java b/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
index ab17c087..609f1939 100644
--- a/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
+++ b/src/github/daneren2005/dsub/activity/EditPlayActionActivity.java
@@ -157,12 +157,12 @@ public class EditPlayActionActivity extends SubsonicActivity {
shuffleCheckbox.setChecked(true);
}
- String startYear = extras.getString(Constants.PREFERENCES_KEY_START_YEAR, null);
+ String startYear = extras.getString(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, null);
if(startYear != null) {
startYearCheckbox.setEnabled(true);
startYearBox.setText(startYear);
}
- String endYear = extras.getString(Constants.PREFERENCES_KEY_END_YEAR, null);
+ String endYear = extras.getString(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, null);
if(endYear != null) {
endYearCheckbox.setEnabled(true);
endYearBox.setText(endYear);
@@ -211,8 +211,28 @@ public class EditPlayActionActivity extends SubsonicActivity {
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);
+ // Get settings user specified
Bundle data = new Bundle();
- data.putBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, shuffleCheckbox.isChecked());
+ boolean shuffle = shuffleCheckbox.isChecked();
+ data.putBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, shuffle);
+ if(shuffle) {
+ if(startYearCheckbox.isChecked()) {
+ data.putString(Constants.PREFERENCES_KEY_SHUFFLE_START_YEAR, startYearBox.getText());
+ }
+ if(endYearCheckbox.isChecked()) {
+ data.putString(Constants.PREFERENCES_KEY_SHUFFLE_END_YEAR, endYearBox.getText());
+ }
+ String genre = genreButton.getText();
+ if(!genre.equals(doNothing)) {
+ data.putString(Constants.PREFERENCES_KEY_SHUFFLE_GENRE, genre);
+ }
+ }
+
+ int offline = offlineSpinner.getSelectedItemPosition();
+ if(offline != 0) {
+ data.putShort(Constants.PREFERENCES_KEY_OFFLINE, (short) offline);
+ }
+
intent.putExtra(Constants.TASKER_EXTRA_BUNDLE, data);
setResult(Activity.RESULT_OK, intent);