[Android] Drop measure if MeasureSpec is incorrect

Geoffrey Métais git at videolan.org
Wed Mar 15 17:42:48 CET 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Mar 15 15:20:45 2017 +0100| [118c92b30f5a9797ce0508c754909615fb22761f] | committer: Geoffrey Métais

Drop measure if MeasureSpec is incorrect

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/view/FlingViewGroup.java b/vlc-android/src/org/videolan/vlc/gui/view/FlingViewGroup.java
index 57737c4..d5ab7fb 100644
--- a/vlc-android/src/org/videolan/vlc/gui/view/FlingViewGroup.java
+++ b/vlc-android/src/org/videolan/vlc/gui/view/FlingViewGroup.java
@@ -82,11 +82,8 @@ public class FlingViewGroup extends ViewGroup {
     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 
-        final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
-
-        if (widthMode != MeasureSpec.EXACTLY ) {
-            throw new IllegalStateException("can only be used in EXACTLY mode.");
-        }
+        if (MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.EXACTLY )
+            return;
 
         final int count = getChildCount();
         int maxHeight = 0;



More information about the Android mailing list