Bug 772940 - Add height setter/getter to AnimatorProxy (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Fri, 12 Oct 2012 13:22:03 +0100
changeset 110205 929e6a56f22f7e7f52e3b251d14354a8bd48155d
parent 110204 a7e92a55d26fea7540dc37cfb255433c28ce535a
child 110206 476e094d0e6b98ab35e3d78c0fce675dd5245758
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmfinkle
bugs772940
milestone19.0a1
Bug 772940 - Add height setter/getter to AnimatorProxy (r=mfinkle)
mobile/android/base/AnimatorProxy.java
--- a/mobile/android/base/AnimatorProxy.java
+++ b/mobile/android/base/AnimatorProxy.java
@@ -4,16 +4,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
 import android.graphics.Matrix;
 import android.graphics.RectF;
 import android.os.Build;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.view.animation.Transformation;
 
 import java.lang.ref.WeakReference;
 import java.util.WeakHashMap;
 
 public class AnimatorProxy {
@@ -51,16 +52,33 @@ public class AnimatorProxy {
 
             proxy = new AnimatorProxy(impl);
             PROXIES.put(view, proxy);
         }
 
         return proxy;
     }
 
+    public int getHeight() {
+        View view = mImpl.getView();
+        if (view != null)
+            return view.getHeight();
+
+        return 0;
+    }
+
+    public void setHeight(int height) {
+        View view = mImpl.getView();
+        if (view != null) {
+            ViewGroup.LayoutParams lp = view.getLayoutParams();
+            lp.height = height;
+            view.setLayoutParams(lp);
+        }
+    }
+
     public int getScrollX() {
         View view = mImpl.getView();
         if (view != null)
             return view.getScrollX();
 
         return 0;
     }