[Android] Fix FAB behavior when audioplayer is GONE
Geoffrey Métais
git at videolan.org
Wed Dec 14 15:03:52 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 14 15:03:26 2016 +0100| [267738e496e9d544540361cbd962530bf6b7e81b] | committer: Geoffrey Métais
Fix FAB behavior when audioplayer is GONE
> https://code.videolan.org/videolan/vlc-android/commit/267738e496e9d544540361cbd962530bf6b7e81b
---
.../org/videolan/vlc/gui/helpers/FloatingActionButtonBehavior.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/FloatingActionButtonBehavior.java b/vlc-android/src/org/videolan/vlc/gui/helpers/FloatingActionButtonBehavior.java
index f6be0ca..ad66f1d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/FloatingActionButtonBehavior.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/FloatingActionButtonBehavior.java
@@ -25,6 +25,7 @@
package org.videolan.vlc.gui.helpers;
import android.content.Context;
+import android.support.annotation.Keep;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
@@ -35,8 +36,11 @@ import android.view.View;
import org.videolan.vlc.R;
+ at Keep
public class FloatingActionButtonBehavior extends FloatingActionButton.Behavior {
+ private static final String TAG = "VLC/FloatingActionButtonBehavior";
+
public FloatingActionButtonBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -48,7 +52,7 @@ public class FloatingActionButtonBehavior extends FloatingActionButton.Behavior
@Override
public boolean onDependentViewChanged(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
- if (dependency.getId() == R.id.audio_player_container) {
+ if (dependency.getId() == R.id.audio_player_container && dependency.getVisibility() == View.VISIBLE) {
int childHeight = ((CoordinatorLayout.LayoutParams)child.getLayoutParams()).bottomMargin + child.getHeight();
ViewCompat.setY(child, ViewCompat.getY(dependency) - childHeight);
return true;
More information about the Android
mailing list