diff options
author | Dominik <dominik@dominikschuermann.de> | 2012-03-11 17:33:40 +0100 |
---|---|---|
committer | Dominik <dominik@dominikschuermann.de> | 2012-03-11 17:33:40 +0100 |
commit | 9b32cf87e2aaa01926cddbb1700b41eed4576dfb (patch) | |
tree | b165dbde9c14ee77a029e7d4f1babae00769e216 /com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java | |
parent | e9c0d7a71157fdff3c4951d91d7a5bc6d1956ef0 (diff) | |
download | open-keychain-9b32cf87e2aaa01926cddbb1700b41eed4576dfb.tar.gz open-keychain-9b32cf87e2aaa01926cddbb1700b41eed4576dfb.tar.bz2 open-keychain-9b32cf87e2aaa01926cddbb1700b41eed4576dfb.zip |
Started using ActionBarSherlock
Diffstat (limited to 'com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java')
-rw-r--r-- | com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java b/com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java new file mode 100644 index 000000000..7b830b9c0 --- /dev/null +++ b/com_actionbarsherlock/src/com/actionbarsherlock/internal/nineoldandroids/view/NineViewGroup.java @@ -0,0 +1,79 @@ +package com.actionbarsherlock.internal.nineoldandroids.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.ViewGroup; + +import com.actionbarsherlock.internal.nineoldandroids.view.animation.AnimatorProxy; + +public abstract class NineViewGroup extends ViewGroup { + private final AnimatorProxy mProxy; + + public NineViewGroup(Context context) { + super(context); + mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null; + } + public NineViewGroup(Context context, AttributeSet attrs) { + super(context, attrs); + mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null; + } + public NineViewGroup(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + mProxy = AnimatorProxy.NEEDS_PROXY ? AnimatorProxy.wrap(this) : null; + } + + @Override + public void setVisibility(int visibility) { + if (mProxy != null) { + if (visibility == GONE) { + clearAnimation(); + } else if (visibility == VISIBLE) { + setAnimation(mProxy); + } + } + super.setVisibility(visibility); + } + + public float getAlpha() { + if (AnimatorProxy.NEEDS_PROXY) { + return mProxy.getAlpha(); + } else { + return super.getAlpha(); + } + } + public void setAlpha(float alpha) { + if (AnimatorProxy.NEEDS_PROXY) { + mProxy.setAlpha(alpha); + } else { + super.setAlpha(alpha); + } + } + public float getTranslationX() { + if (AnimatorProxy.NEEDS_PROXY) { + return mProxy.getTranslationX(); + } else { + return super.getTranslationX(); + } + } + public void setTranslationX(float translationX) { + if (AnimatorProxy.NEEDS_PROXY) { + mProxy.setTranslationX(translationX); + } else { + super.setTranslationX(translationX); + } + } + public float getTranslationY() { + if (AnimatorProxy.NEEDS_PROXY) { + return mProxy.getTranslationY(); + } else { + return super.getTranslationY(); + } + } + public void setTranslationY(float translationY) { + if (AnimatorProxy.NEEDS_PROXY) { + mProxy.setTranslationY(translationY); + } else { + super.setTranslationY(translationY); + } + } +} |