|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 package org.mozilla.gecko.animation; |
|
6 |
|
7 import android.view.View; |
|
8 |
|
9 public final class ViewHelper { |
|
10 private ViewHelper() { |
|
11 } |
|
12 |
|
13 public static float getTranslationX(View view) { |
|
14 AnimatorProxy proxy = AnimatorProxy.create(view); |
|
15 return proxy.getTranslationX(); |
|
16 } |
|
17 |
|
18 public static void setTranslationX(View view, float translationX) { |
|
19 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
20 proxy.setTranslationX(translationX); |
|
21 } |
|
22 |
|
23 public static float getTranslationY(View view) { |
|
24 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
25 return proxy.getTranslationY(); |
|
26 } |
|
27 |
|
28 public static void setTranslationY(View view, float translationY) { |
|
29 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
30 proxy.setTranslationY(translationY); |
|
31 } |
|
32 |
|
33 public static float getAlpha(View view) { |
|
34 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
35 return proxy.getAlpha(); |
|
36 } |
|
37 |
|
38 public static void setAlpha(View view, float alpha) { |
|
39 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
40 proxy.setAlpha(alpha); |
|
41 } |
|
42 |
|
43 public static int getWidth(View view) { |
|
44 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
45 return proxy.getWidth(); |
|
46 } |
|
47 |
|
48 public static void setWidth(View view, int width) { |
|
49 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
50 proxy.setWidth(width); |
|
51 } |
|
52 |
|
53 public static int getHeight(View view) { |
|
54 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
55 return proxy.getHeight(); |
|
56 } |
|
57 |
|
58 public static void setHeight(View view, int height) { |
|
59 final AnimatorProxy proxy = AnimatorProxy.create(view); |
|
60 proxy.setHeight(height); |
|
61 } |
|
62 } |