[Android] Audio browser: remove the OnLayoutChangeListener of the HeaderScrollView as it is not available before API 11

Adrien Maglo git at videolan.org
Wed Nov 27 14:26:29 CET 2013


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Wed Nov 27 14:24:20 2013 +0100| [b639c457971835f8a990d2573d25c2fa204f875d] | committer: Adrien Maglo

Audio browser: remove the OnLayoutChangeListener of the HeaderScrollView as it is not available before API 11

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=b639c457971835f8a990d2573d25c2fa204f875d
---

 .../src/org/videolan/vlc/widget/HeaderScrollView.java   |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/widget/HeaderScrollView.java b/vlc-android/src/org/videolan/vlc/widget/HeaderScrollView.java
index 253f711..189b0ef 100644
--- a/vlc-android/src/org/videolan/vlc/widget/HeaderScrollView.java
+++ b/vlc-android/src/org/videolan/vlc/widget/HeaderScrollView.java
@@ -38,14 +38,6 @@ public class HeaderScrollView extends HorizontalScrollView {
 
     public HeaderScrollView(Context context, AttributeSet attrs) {
         super(context, attrs);
-
-        addOnLayoutChangeListener(new OnLayoutChangeListener() {
-            @Override
-            public void onLayoutChange(View v, int left, int top, int right, int bottom,
-                    int oldLeft, int oldTop, int oldRight, int oldBottom) {
-                restoreScroll();
-            }
-        });
     }
 
     @Override
@@ -67,11 +59,16 @@ public class HeaderScrollView extends HorizontalScrollView {
                         lp.setMargins(0, 0, mTabWidth / 2, 0);
                     t.setLayoutParams(lp);
                 }
-                requestLayout();
             }
         });
     }
 
+    @Override
+    protected void onLayout (boolean changed, int l, int t, int r, int b) {
+        super.onLayout(changed, l, t, r, b);
+        restoreScroll();
+    }
+
     public void scroll(float progress) {
         mProgress = progress;
         restoreScroll();



More information about the Android mailing list