use of android.view.animation.AlphaAnimation in project UltimateAndroid by cymcsg.
the class TileManager method renderIndividualTile.
// package level access so it can be invoked by the render task
void renderIndividualTile(Tile tile) {
// if it's already rendered, quit now
if (alreadyRendered.contains(tile)) {
return;
}
// create the image view if needed, with default settings
tile.render(getContext());
// add it to the list of those rendered
alreadyRendered.add(tile);
// get reference to the actual image view
ImageView imageView = tile.getImageView();
// get layout params from the tile's predefined dimensions
LayoutParams layoutParams = getLayoutFromTile(tile);
// add it to the appropriate set (which is already scaled)
currentTileGroup.addView(imageView, layoutParams);
// shouldn't be necessary, but is
postInvalidate();
// do we want to animate in tiles?
if (transitionsEnabled) {
// do we have an appropriate duration?
if (transitionDuration > 0) {
// create the animation (will be cleared by tile.destroy). do this here for the postInvalidate listener
AlphaAnimation fadeIn = new AlphaAnimation(0f, 1f);
// set duration
fadeIn.setDuration(transitionDuration);
// this listener posts invalidate on complete, again should not be necessary but is
fadeIn.setAnimationListener(transitionListener);
// start it up
imageView.startAnimation(fadeIn);
}
}
}
use of android.view.animation.AlphaAnimation in project cw-omnibus by commonsguy.
the class IcsProgressBar method startAnimation.
/**
* <p>Start the indeterminate progress animation.</p>
*/
void startAnimation() {
if (getVisibility() != VISIBLE) {
return;
}
if (mIndeterminateDrawable instanceof Animatable) {
mShouldStartAnimationDrawable = true;
mAnimation = null;
} else {
if (mInterpolator == null) {
mInterpolator = new LinearInterpolator();
}
mTransformation = new Transformation();
mAnimation = new AlphaAnimation(0.0f, 1.0f);
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 baseAdapter by hongyangAndroid.
the class ViewHolder method setAlpha.
@SuppressLint("NewApi")
public ViewHolder 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;
}
use of android.view.animation.AlphaAnimation in project nmid-headline by miao1007.
the class Animations method FadeOut.
public static Animation FadeOut() {
Animation anim = new AlphaAnimation(1, 0);
anim.setInterpolator(new DecelerateInterpolator());
anim.setDuration(500);
return anim;
}
use of android.view.animation.AlphaAnimation in project nmid-headline by miao1007.
the class Animations method FadeIn.
public static Animation FadeIn() {
Animation anim = new AlphaAnimation(0, 1);
anim.setInterpolator(new DecelerateInterpolator());
anim.setDuration(500);
return anim;
}
Aggregations