1 package com
.actionbarsherlock
.internal
.nineoldandroids
.view
;
3 import android
.content
.Context
;
4 import android
.util
.AttributeSet
;
5 import android
.view
.ViewGroup
;
7 import com
.actionbarsherlock
.internal
.nineoldandroids
.view
.animation
.AnimatorProxy
;
9 public abstract class NineViewGroup
extends ViewGroup
{
10 private final AnimatorProxy mProxy
;
12 public NineViewGroup(Context context
) {
14 mProxy
= AnimatorProxy
.NEEDS_PROXY ? AnimatorProxy
.wrap(this) : null
;
16 public NineViewGroup(Context context
, AttributeSet attrs
) {
17 super(context
, attrs
);
18 mProxy
= AnimatorProxy
.NEEDS_PROXY ? AnimatorProxy
.wrap(this) : null
;
20 public NineViewGroup(Context context
, AttributeSet attrs
, int defStyle
) {
21 super(context
, attrs
, defStyle
);
22 mProxy
= AnimatorProxy
.NEEDS_PROXY ? AnimatorProxy
.wrap(this) : null
;
26 public void setVisibility(int visibility
) {
28 if (visibility
== GONE
) {
30 } else if (visibility
== VISIBLE
) {
34 super.setVisibility(visibility
);
37 public float getAlpha() {
38 if (AnimatorProxy
.NEEDS_PROXY
) {
39 return mProxy
.getAlpha();
41 return super.getAlpha();
44 public void setAlpha(float alpha
) {
45 if (AnimatorProxy
.NEEDS_PROXY
) {
46 mProxy
.setAlpha(alpha
);
48 super.setAlpha(alpha
);
51 public float getTranslationX() {
52 if (AnimatorProxy
.NEEDS_PROXY
) {
53 return mProxy
.getTranslationX();
55 return super.getTranslationX();
58 public void setTranslationX(float translationX
) {
59 if (AnimatorProxy
.NEEDS_PROXY
) {
60 mProxy
.setTranslationX(translationX
);
62 super.setTranslationX(translationX
);
65 public float getTranslationY() {
66 if (AnimatorProxy
.NEEDS_PROXY
) {
67 return mProxy
.getTranslationY();
69 return super.getTranslationY();
72 public void setTranslationY(float translationY
) {
73 if (AnimatorProxy
.NEEDS_PROXY
) {
74 mProxy
.setTranslationY(translationY
);
76 super.setTranslationY(translationY
);