diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-06-05 20:30:53 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-06-05 20:30:53 -0700 |
commit | 76f08212f4eb110f80661c6929c9af68a2c8a422 (patch) | |
tree | 095ff0a4545156cd0a25423d14f76a9ab040fc4e /src | |
parent | 0fd7e7f6be0efd44fca62b828ac32c88bb7337f5 (diff) | |
download | dsub-76f08212f4eb110f80661c6929c9af68a2c8a422.tar.gz dsub-76f08212f4eb110f80661c6929c9af68a2c8a422.tar.bz2 dsub-76f08212f4eb110f80661c6929c9af68a2c8a422.zip |
Don't trigger toggle view on bottom portion of album art
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/fragments/NowPlayingFragment.java | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 13bfd53d..924c5bd0 100644 --- a/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/src/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -130,6 +130,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis private boolean seekInProgress = false;
private boolean startFlipped = false;
private boolean scrollWhenLoaded = false;
+ private int lastY = 0;
/**
* Called when the activity is first created.
@@ -218,7 +219,15 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis visualizerButton.setOnTouchListener(touchListener);
bookmarkButton.setOnTouchListener(touchListener);
emptyTextView.setOnTouchListener(touchListener);
- albumArtImageView.setOnTouchListener(touchListener);
+ albumArtImageView.setOnTouchListener(new View.OnTouchListener() {
+ @Override
+ public boolean onTouch(View v, MotionEvent me) {
+ if(me.getAction() == MotionEvent.ACTION_DOWN) {
+ lastY = (int) me.getRawY();
+ }
+ return gestureScanner.onTouchEvent(me);
+ }
+ });
previousButton.setOnClickListener(new View.OnClickListener() {
@Override
@@ -394,16 +403,25 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis }
});
- View.OnClickListener toggleListener = new View.OnClickListener() {
+ toggleListButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
toggleFullscreenAlbumArt();
setControlsVisible(true);
}
- };
+ });
- toggleListButton.setOnClickListener(toggleListener);
- albumArtImageView.setOnClickListener(toggleListener);
+ View overlay = rootView.findViewById(R.id.download_overlay_buttons);
+ final int overlayHeight = overlay != null ? overlay.getHeight() : -1;
+ albumArtImageView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if(overlayHeight == -1 || lastY < (view.getBottom() - overlayHeight)) {
+ toggleFullscreenAlbumArt();
+ setControlsVisible(true);
+ }
+ }
+ });
progressBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
|