1 package com.actionbarsherlock.internal.nineoldandroids.widget;
3 import android.content.Context;
4 import android.util.AttributeSet;
5 import android.widget.LinearLayout;
7 import com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy;
9 public class NineLinearLayout extends LinearLayout {
10 private final AnimatorProxy mProxy;
12 public NineLinearLayout(Context context) {
14 mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null;
16 public NineLinearLayout(Context context, AttributeSet attrs) {
17 super(context, attrs);
18 mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null;
20 public NineLinearLayout(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);