use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.
the class DragState method createReturnAnimationLocked.
private Animation createReturnAnimationLocked() {
final AnimationSet set = new AnimationSet(false);
set.addAnimation(new TranslateAnimation(0, mOriginalX - mCurrentX, 0, mOriginalY - mCurrentY));
set.addAnimation(new AlphaAnimation(mOriginalAlpha, mOriginalAlpha / 2));
set.setDuration(ANIMATION_DURATION_MS);
set.setInterpolator(mCubicEaseOutInterpolator);
set.initialize(0, 0, 0, 0);
// Will start on the first call to getTransformation.
set.start();
return set;
}
use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.
the class DragState method createCancelAnimationLocked.
private Animation createCancelAnimationLocked() {
final AnimationSet set = new AnimationSet(false);
set.addAnimation(new ScaleAnimation(1, 0, 1, 0, mThumbOffsetX, mThumbOffsetY));
set.addAnimation(new AlphaAnimation(mOriginalAlpha, 0));
set.setDuration(ANIMATION_DURATION_MS);
set.setInterpolator(mCubicEaseOutInterpolator);
set.initialize(0, 0, 0, 0);
// Will start on the first call to getTransformation.
set.start();
return set;
}
use of android.view.animation.AlphaAnimation in project android_frameworks_base by ResurrectionRemix.
the class ProgressBar method startAnimation.
/**
* <p>Start the indeterminate progress animation.</p>
*/
void startAnimation() {
if (getVisibility() != VISIBLE || getWindowVisibility() != VISIBLE) {
return;
}
if (mIndeterminateDrawable instanceof Animatable) {
mShouldStartAnimationDrawable = true;
mHasAnimation = false;
} else {
mHasAnimation = true;
if (mInterpolator == null) {
mInterpolator = new LinearInterpolator();
}
if (mTransformation == null) {
mTransformation = new Transformation();
} else {
mTransformation.clear();
}
if (mAnimation == null) {
mAnimation = new AlphaAnimation(0.0f, 1.0f);
} else {
mAnimation.reset();
}
mAnimation.setRepeatMode(mBehavior);
mAnimation.setRepeatCount(Animation.INFINITE);
mAnimation.setDuration(mDuration);
mAnimation.setInterpolator(mInterpolator);
mAnimation.setStartTime(Animation.START_ON_FIRST_FRAME);
}
postInvalidate();
}
use of android.view.animation.AlphaAnimation in project AprilBeacon-Android-SDK by AprilBrother.
the class NotifyInContentActivity method setAnimtionStart.
private void setAnimtionStart() {
ImageView iv = (ImageView) findViewById(R.id.iv_notify_content_in);
AlphaAnimation alphaAnimation = new AlphaAnimation(0.1f, 1.0f);
alphaAnimation.setDuration(3000);
iv.startAnimation(alphaAnimation);
}
use of android.view.animation.AlphaAnimation in project BaseRecyclerViewAdapterHelper by CymChad.
the class BaseViewHolder method setAlpha.
/**
* Add an action to set the alpha of a view. Can be called multiple times.
* Alpha between 0-1.
*/
public BaseViewHolder setAlpha(int viewId, float value) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
getView(viewId).setAlpha(value);
} else {
// Pre-honeycomb hack to set Alpha value
AlphaAnimation alpha = new AlphaAnimation(value, value);
alpha.setDuration(0);
alpha.setFillAfter(true);
getView(viewId).startAnimation(alpha);
}
return this;
}
Aggregations