AppBarLayout scrolling awesomeness, PlayQueue layout touches interception, player's controls' margin
- made scrolling in appBarLayout awesome - PlayQueue layout was intercepting touches while it was in GONE visibility state. Now it's not gonna happen - removed margin between two lines of player's controls - when a user leaves the app with two back presses the app will not stop MainPlayer service if popup or background players play
This commit is contained in:
parent
f334a2740f
commit
a47e6dd8c5
8 changed files with 69 additions and 102 deletions
|
|
@ -23,14 +23,14 @@ public final class FlingBehavior extends AppBarLayout.Behavior {
|
|||
}
|
||||
|
||||
private boolean allowScroll = true;
|
||||
private Rect playQueueRect = new Rect();
|
||||
private Rect globalRect = new Rect();
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(CoordinatorLayout parent, AppBarLayout child, MotionEvent ev) {
|
||||
ViewGroup playQueue = child.findViewById(R.id.playQueue);
|
||||
ViewGroup playQueue = child.findViewById(R.id.playQueuePanel);
|
||||
if (playQueue != null) {
|
||||
playQueue.getGlobalVisibleRect(playQueueRect);
|
||||
if (playQueueRect.contains((int) ev.getRawX(), (int) ev.getRawY())) {
|
||||
boolean visible = playQueue.getGlobalVisibleRect(globalRect);
|
||||
if (visible && globalRect.contains((int) ev.getRawX(), (int) ev.getRawY())) {
|
||||
allowScroll = false;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue