aboutsummaryrefslogtreecommitdiff
path: root/subsonic-android
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2012-09-11 21:36:52 -0700
committerScott Jackson <daneren2005@gmail.com>2012-09-11 21:36:52 -0700
commit5eadac48eb97f7480e2629e46a6159cdcb21e1a2 (patch)
tree00a6d5084031cee25a3b6971f889fc5027382545 /subsonic-android
parent959c6551d2ca834c88813e775c1209565d95a3e1 (diff)
downloaddsub-5eadac48eb97f7480e2629e46a6159cdcb21e1a2.tar.gz
dsub-5eadac48eb97f7480e2629e46a6159cdcb21e1a2.tar.bz2
dsub-5eadac48eb97f7480e2629e46a6159cdcb21e1a2.zip
Merged Play Now/Shuffle/Select All into action bar, updated help/settings/exist icons for all menus
Diffstat (limited to 'subsonic-android')
-rw-r--r--subsonic-android/res/drawable-hdpi-v4/action_select.png (renamed from subsonic-android/res/drawable-hdpi-v4/action_playlists.png)bin1158 -> 1158 bytes
-rw-r--r--subsonic-android/res/layout/select_album.xml45
-rw-r--r--subsonic-android/res/menu/main.xml6
-rw-r--r--subsonic-android/res/menu/select_album.xml18
-rw-r--r--subsonic-android/res/menu/select_artist.xml2
-rw-r--r--subsonic-android/res/menu/select_playlist.xml2
-rw-r--r--subsonic-android/res/values/strings.xml1
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java50
8 files changed, 41 insertions, 83 deletions
diff --git a/subsonic-android/res/drawable-hdpi-v4/action_playlists.png b/subsonic-android/res/drawable-hdpi-v4/action_select.png
index e9e83e3d..e9e83e3d 100644
--- a/subsonic-android/res/drawable-hdpi-v4/action_playlists.png
+++ b/subsonic-android/res/drawable-hdpi-v4/action_select.png
Binary files differ
diff --git a/subsonic-android/res/layout/select_album.xml b/subsonic-android/res/layout/select_album.xml
index d5a4d0d1..59860e28 100644
--- a/subsonic-android/res/layout/select_album.xml
+++ b/subsonic-android/res/layout/select_album.xml
@@ -62,47 +62,8 @@
android:layout_width="0dp"
android:layout_height="fill_parent"
android:visibility="gone"/>
-
- </LinearLayout>
-
- <LinearLayout android:orientation="horizontal"
- android:layout_marginTop="6dp"
- android:layout_marginBottom="3dp"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content">
-
- <Button android:id="@+id/select_album_select"
- android:text="@string/select_album.select"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="6dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- <Button android:id="@+id/select_album_play_now"
- android:text="@string/common.play_now"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- <Button android:id="@+id/select_album_play_shuffled"
- android:text="@string/common.play_shuffled"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- android:layout_marginLeft="3dp"
- android:layout_marginRight="3dp"
- android:layout_weight="1"
- android:layout_width="0dp"
- android:layout_height="fill_parent"/>
-
- <Button android:id="@+id/select_album_play_last"
+ <Button android:id="@+id/select_album_play_last"
android:text="@string/common.play_last"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone"
@@ -111,8 +72,8 @@
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="fill_parent"/>
-
- </LinearLayout>
+
+ </LinearLayout>
<include layout="@layout/button_bar"/>
diff --git a/subsonic-android/res/menu/main.xml b/subsonic-android/res/menu/main.xml
index af6a5a7d..a7642942 100644
--- a/subsonic-android/res/menu/main.xml
+++ b/subsonic-android/res/menu/main.xml
@@ -14,17 +14,17 @@
<item
android:id="@+id/menu_help"
- android:icon="@drawable/ic_menu_help"
+ android:icon="@drawable/action_help"
android:title="@string/menu.help"/>
<item
android:id="@+id/menu_settings"
- android:icon="@drawable/ic_menu_settings"
+ android:icon="@drawable/action_settings"
android:title="@string/menu.settings"/>
<item
android:id="@+id/menu_exit"
- android:icon="@drawable/ic_menu_exit"
+ android:icon="@drawable/action_exit"
android:title="@string/menu.exit"/>
</menu>
diff --git a/subsonic-android/res/menu/select_album.xml b/subsonic-android/res/menu/select_album.xml
index a5f2a3a9..87fbab3e 100644
--- a/subsonic-android/res/menu/select_album.xml
+++ b/subsonic-android/res/menu/select_album.xml
@@ -1,16 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
- android:id="@+id/menu_play_all"
+ android:id="@+id/menu_play_now"
android:icon="@drawable/action_play_all"
android:title="@string/menu.play"
android:showAsAction="ifRoom|withText"/>
-
+
<item
android:id="@+id/menu_refresh"
android:icon="@drawable/action_refresh"
android:title="@string/menu.refresh"
android:showAsAction="ifRoom|withText"/>
+
+ <item
+ android:id="@+id/menu_shuffle"
+ android:icon="@drawable/action_shuffle"
+ android:title="@string/menu.shuffle"
+ android:showAsAction="ifRoom|withText"/>
+
+ <item
+ android:id="@+id/menu_select"
+ android:icon="@drawable/action_select"
+ android:title="@string/menu.select"
+ android:showAsAction="ifRoom|withText"/>
<item
android:id="@+id/menu_help"
@@ -24,7 +36,7 @@
<item
android:id="@+id/menu_exit"
- android:icon="@drawable/ic_menu_exit"
+ android:icon="@drawable/action_exit"
android:title="@string/menu.exit"/>
</menu>
diff --git a/subsonic-android/res/menu/select_artist.xml b/subsonic-android/res/menu/select_artist.xml
index 42916622..84c0e370 100644
--- a/subsonic-android/res/menu/select_artist.xml
+++ b/subsonic-android/res/menu/select_artist.xml
@@ -24,7 +24,7 @@
<item
android:id="@+id/menu_exit"
- android:icon="@drawable/ic_menu_exit"
+ android:icon="@drawable/action_exit"
android:title="@string/menu.exit"/>
</menu>
diff --git a/subsonic-android/res/menu/select_playlist.xml b/subsonic-android/res/menu/select_playlist.xml
index 46d863cd..3e0f33b6 100644
--- a/subsonic-android/res/menu/select_playlist.xml
+++ b/subsonic-android/res/menu/select_playlist.xml
@@ -18,7 +18,7 @@
<item
android:id="@+id/menu_exit"
- android:icon="@drawable/ic_menu_exit"
+ android:icon="@drawable/action_exit"
android:title="@string/menu.exit"/>
</menu>
diff --git a/subsonic-android/res/values/strings.xml b/subsonic-android/res/values/strings.xml
index ea926fd9..a3b6f604 100644
--- a/subsonic-android/res/values/strings.xml
+++ b/subsonic-android/res/values/strings.xml
@@ -36,6 +36,7 @@
<string name="menu.search">Search</string>
<string name="menu.shuffle">Shuffle</string>
<string name="menu.refresh">Refresh</string>
+ <string name="menu.select">Select All</string>
<string name="menu.play">Play</string>
<string name="menu.exit">Exit</string>
<string name="menu.settings">Settings</string>
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
index c0013d6f..3e0c496a 100644
--- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
+++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectAlbumActivity.java
@@ -56,9 +56,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
private ListView entryList;
private View footer;
private View emptyView;
- private Button selectButton;
- private Button playNowButton;
- private Button playShuffledButton;
private Button playLastButton;
private Button pinButton;
private Button unpinButton;
@@ -97,9 +94,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
}
});
- selectButton = (Button) findViewById(R.id.select_album_select);
- playNowButton = (Button) findViewById(R.id.select_album_play_now);
- playShuffledButton = (Button) findViewById(R.id.select_album_play_shuffled);
playLastButton = (Button) findViewById(R.id.select_album_play_last);
pinButton = (Button) findViewById(R.id.select_album_pin);
unpinButton = (Button) findViewById(R.id.select_album_unpin);
@@ -107,26 +101,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
moreButton = (Button) footer.findViewById(R.id.select_album_more);
emptyView = findViewById(R.id.select_album_empty);
- selectButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- selectAllOrNone();
- }
- });
- playNowButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- download(false, false, true, false, false);
- selectAll(false, false);
- }
- });
- playShuffledButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- download(false, false, true, false, true);
- selectAll(false, false);
- }
- });
playLastButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -188,8 +162,14 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
public boolean onOptionsItemSelected(com.actionbarsherlock.view.MenuItem item) {
Intent intent;
switch (item.getItemId()) {
- case R.id.menu_play_all:
- playAll(false);
+ case R.id.menu_play_now:
+ playNow(false);
+ return true;
+ case R.id.menu_shuffle:
+ playNow(true);
+ return true;
+ case R.id.menu_select:
+ selectAllOrNone();
return true;
case R.id.menu_refresh:
refresh();
@@ -211,6 +191,15 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
return false;
}
+ private void playNow(final boolean shuffle) {
+ if(getSelectedSongs().size() > 0) {
+ download(false, false, true, false, shuffle);
+ selectAll(false, false);
+ }
+ else {
+ playAll(shuffle);
+ }
+ }
private void playAll(final boolean shuffle) {
boolean hasSubFolders = false;
for (int i = 0; i < entryList.getCount(); i++) {
@@ -411,8 +400,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
}
}
- playNowButton.setEnabled(enabled);
- playShuffledButton.setEnabled(enabled);
playLastButton.setEnabled(enabled);
pinButton.setEnabled(enabled && !Util.isOffline(this));
unpinButton.setEnabled(unpinEnabled);
@@ -567,9 +554,6 @@ public class SelectAlbumActivity extends SubsonicTabActivity {
if (songCount > 0) {
getImageLoader().loadImage(getSupportActionBar(), entries.get(0));
entryList.addFooterView(footer);
- selectButton.setVisibility(View.VISIBLE);
- playNowButton.setVisibility(View.VISIBLE);
- playShuffledButton.setVisibility(View.VISIBLE);
playLastButton.setVisibility(View.VISIBLE);
pinButton.setVisibility(View.VISIBLE);
unpinButton.setVisibility(View.VISIBLE);