1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2024-12-28 09:40:27 +01:00

Show EQ, Visualzier and Jukebox buttons if room

This commit is contained in:
Joshua Bahnsen 2013-01-17 01:23:04 -07:00
parent 5ab323d4bf
commit 19839cfd0d
3 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="net.sourceforge.subsonic.androidapp"
a:versionCode="47"
a:versionName="3.9.9.7" a:installLocation="auto">
a:versionName="3.9.9.8" a:installLocation="auto">
<uses-permission a:name="android.permission.INTERNET"/>
<uses-permission a:name="android.permission.READ_PHONE_STATE"/>

View File

@ -3,16 +3,19 @@
<item
a:id="@+id/download_equalizer"
a:showAsAction="ifRoom|withText"
a:title="@string/download.menu_equalizer"
/>
<item
a:id="@+id/download_visualizer"
a:showAsAction="ifRoom|withText"
a:title="@string/download.menu_visualizer"
/>
<item
a:id="@+id/download_jukebox"
a:showAsAction="ifRoom|withText"
a:title="@string/download.menu_jukebox"
/>

View File

@ -290,7 +290,6 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
visualizerAvailable = downloadService != null && downloadService.getVisualizerController() != null;
equalizerAvailable = downloadService != null && downloadService.getEqualizerController() != null;
if (visualizerAvailable) {
visualizerView = new VisualizerView(this);
visualizerViewLayout.addView(visualizerView, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
@ -300,7 +299,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
public boolean onTouch(View view, MotionEvent motionEvent) {
visualizerView.setActive(!visualizerView.isActive());
getDownloadService().setShowVisualization(visualizerView.isActive());
updateButtons();
//updateButtons();
return true;
}
});
@ -347,7 +346,7 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
visualizerView.setActive(downloadService != null && downloadService.getShowVisualization());
}
updateButtons();
//updateButtons();
}
private void updateButtons() {
@ -559,13 +558,13 @@ public class DownloadActivity extends SubsonicTabActivity implements OnGestureLi
boolean active = !visualizerView.isActive();
visualizerView.setActive(active);
getDownloadService().setShowVisualization(visualizerView.isActive());
updateButtons();
//updateButtons();
Util.toast(DownloadActivity.this, active ? R.string.download_visualizer_on : R.string.download_visualizer_off);
return true;
case R.id.download_jukebox:
boolean jukeboxEnabled = !getDownloadService().isJukeboxEnabled();
getDownloadService().setJukeboxEnabled(jukeboxEnabled);
updateButtons();
//updateButtons();
Util.toast(DownloadActivity.this, jukeboxEnabled ? R.string.download_jukebox_on : R.string.download_jukebox_off, false);
return true;
default: