[Android] Check window size on touch in popup

Geoffrey Métais git at videolan.org
Fri May 20 16:30:57 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 20 12:43:57 2016 +0200| [c69f3c95d58707a65ef960ed4ffc217b1a26a786] | committer: Geoffrey Métais

Check window size on touch in popup

> https://code.videolan.org/videolan/vlc-android/commit/c69f3c95d58707a65ef960ed4ffc217b1a26a786
---

 vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java b/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
index ec29a5c..e55fe62 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
+++ b/vlc-android/src/org/videolan/vlc/gui/view/PopupLayout.java
@@ -123,6 +123,10 @@ public class PopupLayout extends RelativeLayout implements ScaleGestureDetector.
         mWindowManager.addView(this, params);
         mLayoutParams = (WindowManager.LayoutParams)getLayoutParams();
 
+        updateWindowSize();
+    }
+
+    private void updateWindowSize() {
         if (AndroidUtil.isHoneycombMr2OrLater()) {
             Point size = new Point();
             mWindowManager.getDefaultDisplay().getSize(size);
@@ -146,6 +150,7 @@ public class PopupLayout extends RelativeLayout implements ScaleGestureDetector.
                 initialY = mLayoutParams.y;
                 initialTouchX = event.getRawX();
                 initialTouchY = event.getRawY();
+                updateWindowSize();
                 return true;
             case MotionEvent.ACTION_UP:
                 return true;



More information about the Android mailing list