aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2013-04-20 21:19:35 -0700
committerScott Jackson <daneren2005@gmail.com>2013-04-20 21:19:35 -0700
commit7e8a48fc4e0fb31af944c867c9e2c1e133f4a451 (patch)
tree8427dbd86ddda4b0338550ac913658b78c3eef10 /subsonic-android/src/github/daneren2005
parentd641f0831535c8ff1996b45da76fced20e5e7544 (diff)
downloaddsub-7e8a48fc4e0fb31af944c867c9e2c1e133f4a451.tar.gz
dsub-7e8a48fc4e0fb31af944c867c9e2c1e133f4a451.tar.bz2
dsub-7e8a48fc4e0fb31af944c867c9e2c1e133f4a451.zip
Fix a few DownloadFragment functions + added up on DownloadActivity
Diffstat (limited to 'subsonic-android/src/github/daneren2005')
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java21
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java6
2 files changed, 22 insertions, 5 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
index b43bb58a..2204cb64 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/DownloadActivity.java
@@ -30,8 +30,9 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import android.app.AlertDialog;
import android.content.DialogInterface;
+import android.content.Intent;
import android.view.View;
-import android.view.ViewGroup;
+import com.actionbarsherlock.view.MenuItem;
import github.daneren2005.dsub.domain.MusicDirectory;
import github.daneren2005.dsub.service.DownloadFile;
import github.daneren2005.dsub.service.MusicService;
@@ -58,6 +59,22 @@ public class DownloadActivity extends SubsonicActivity {
fragment = new DownloadFragment();
getSupportFragmentManager().beginTransaction().add(R.id.download_container, fragment).commit();
}
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if(item.getItemId() == android.R.id.home) {
+ Intent i = new Intent();
+ i.setClass(this, MainActivity.class);
+ i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(i);
+ return true;
+ } else {
+ return false;
+ }
}
@Override
@@ -114,7 +131,7 @@ public class DownloadActivity extends SubsonicActivity {
}
}
}
-
+
private void savePlaylistInBackground(final String playlistName) {
Util.toast(this, getResources().getString(R.string.download_playlist_saving, playlistName));
getDownloadService().setSuggestedPlaylistName(playlistName);
diff --git a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
index 68140328..a38f9fcd 100644
--- a/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
+++ b/subsonic-android/src/github/daneren2005/dsub/fragments/DownloadFragment.java
@@ -154,7 +154,7 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
DownloadFile currentDownload = getDownloadService().getCurrentPlaying();
if (currentDownload != null) {
MusicDirectory.Entry currentSong = currentDownload.getSong();
- // toggleStarred(currentSong);
+ toggleStarred(currentSong);
starButton.setImageResource(currentSong.isStarred() ? android.R.drawable.btn_star_big_on : android.R.drawable.btn_star_big_off);
}
}
@@ -424,11 +424,11 @@ public class DownloadFragment extends SubsonicFragment implements OnGestureListe
registerForContextMenu(playlistView);
DownloadService downloadService = getDownloadService();
- /*if (downloadService != null && getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false)) {
+ if (downloadService != null && context.getIntent().getBooleanExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE, false)) {
context.getIntent().removeExtra(Constants.INTENT_EXTRA_NAME_SHUFFLE);
warnIfNetworkOrStorageUnavailable();
downloadService.setShufflePlayEnabled(true);
- }*/
+ }
boolean visualizerAvailable = downloadService != null && downloadService.getVisualizerAvailable();
boolean equalizerAvailable = downloadService != null && downloadService.getEqualizerAvailable();