mobile/android/base/animation/ViewHelper.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/animation/ViewHelper.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.animation;
     1.9 +
    1.10 +import android.view.View;
    1.11 +
    1.12 +public final class ViewHelper {
    1.13 +	private ViewHelper() {
    1.14 +	}
    1.15 +
    1.16 +	public static float getTranslationX(View view) {
    1.17 +		AnimatorProxy proxy = AnimatorProxy.create(view);
    1.18 +		return proxy.getTranslationX();
    1.19 +	}
    1.20 +
    1.21 +	public static void setTranslationX(View view, float translationX) {
    1.22 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.23 +		proxy.setTranslationX(translationX);
    1.24 +	}
    1.25 +
    1.26 +	public static float getTranslationY(View view) {
    1.27 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.28 +		return proxy.getTranslationY();
    1.29 +	}
    1.30 +
    1.31 +	public static void setTranslationY(View view, float translationY) {
    1.32 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.33 +		proxy.setTranslationY(translationY);
    1.34 +	}
    1.35 +
    1.36 +	public static float getAlpha(View view) {
    1.37 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.38 +		return proxy.getAlpha();
    1.39 +	}
    1.40 +
    1.41 +	public static void setAlpha(View view, float alpha) {
    1.42 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.43 +		proxy.setAlpha(alpha);
    1.44 +	}
    1.45 +
    1.46 +	public static int getWidth(View view) {
    1.47 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.48 +		return proxy.getWidth();
    1.49 +	}
    1.50 +
    1.51 +	public static void setWidth(View view, int width) {
    1.52 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.53 +		proxy.setWidth(width);
    1.54 +	}
    1.55 +
    1.56 +	public static int getHeight(View view) {
    1.57 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.58 +		return proxy.getHeight();
    1.59 +	}
    1.60 +
    1.61 +	public static void setHeight(View view, int height) {
    1.62 +		final AnimatorProxy proxy = AnimatorProxy.create(view);
    1.63 +		proxy.setHeight(height);
    1.64 +	}
    1.65 +}

mercurial