use of android.view.animation.ScaleAnimation in project Signal-Android by WhisperSystems.
the class AttachmentTypeSelector method animateButtonIn.
private void animateButtonIn(View button, int delay) {
AnimationSet animation = new AnimationSet(true);
Animation scale = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.0f);
animation.addAnimation(scale);
animation.setInterpolator(new OvershootInterpolator(1));
animation.setDuration(ANIMATION_DURATION);
animation.setStartOffset(delay);
button.startAnimation(animation);
}
use of android.view.animation.ScaleAnimation in project actor-platform by actorapp.
the class ViewUtils method wave.
public static void wave(final View layer, float scale, int duration, float stepOffset) {
final ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, scale, 1.0f, scale, Animation.RELATIVE_TO_SELF, (float) 0.5, Animation.RELATIVE_TO_SELF, (float) 0.5);
scaleAnimation.setDuration(duration);
scaleAnimation.setInterpolator(new OffsetCycleInterpolator(stepOffset));
scaleAnimation.setRepeatCount(Animation.INFINITE);
layer.clearAnimation();
layer.startAnimation(scaleAnimation);
}
use of android.view.animation.ScaleAnimation in project actor-platform by actorapp.
the class ViewUtils method demoteView.
public static void demoteView(final View view, boolean isAnimated) {
if (view == null) {
return;
}
if (isAnimated) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.1f, 1.0f, 1.1f, 1.0f, Animation.RELATIVE_TO_SELF, (float) 0.5, Animation.RELATIVE_TO_SELF, (float) 0.5);
scaleAnimation.setDuration(isAnimated ? 150 : 0);
scaleAnimation.setInterpolator(MaterialInterpolator.getInstance());
scaleAnimation.setFillAfter(true);
view.clearAnimation();
view.startAnimation(scaleAnimation);
}
}
use of android.view.animation.ScaleAnimation in project SmartAndroidSource by jaychou2012.
the class DragGridView method animateDragged.
// EVENT HELPERS
protected void animateDragged() {
View v = getChildAt(dragged);
int x = getCoorFromIndex(dragged).x + childSize / 2, y = getCoorFromIndex(dragged).y + childSize / 2;
int l = x - (3 * childSize / 4), t = y - (3 * childSize / 4);
v.layout(l, t, l + (childSize * 3 / 2), t + (childSize * 3 / 2));
AnimationSet animSet = new AnimationSet(true);
ScaleAnimation scale = new ScaleAnimation(.667f, 1, .667f, 1, childSize * 3 / 4, childSize * 3 / 4);
scale.setDuration(animT);
AlphaAnimation alpha = new AlphaAnimation(1, .5f);
alpha.setDuration(animT);
animSet.addAnimation(scale);
animSet.addAnimation(alpha);
animSet.setFillEnabled(true);
animSet.setFillAfter(true);
v.clearAnimation();
v.startAnimation(animSet);
}
use of android.view.animation.ScaleAnimation in project SmartAndroidSource by jaychou2012.
the class DragGridViewPager method animateDragged.
private void animateDragged() {
if (mLastDragged >= 0) {
final View v = getChildAt(mLastDragged);
final Rect r = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
r.inset(-r.width() / 20, -r.height() / 20);
v.measure(MeasureSpec.makeMeasureSpec(r.width(), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(r.height(), MeasureSpec.EXACTLY));
v.layout(r.left, r.top, r.right, r.bottom);
AnimationSet animSet = new AnimationSet(true);
ScaleAnimation scale = new ScaleAnimation(0.9091f, 1, 0.9091f, 1, v.getWidth() / 2, v.getHeight() / 2);
scale.setDuration(ANIMATION_DURATION);
AlphaAnimation alpha = new AlphaAnimation(1, .5f);
alpha.setDuration(ANIMATION_DURATION);
animSet.addAnimation(scale);
animSet.addAnimation(alpha);
animSet.setFillEnabled(true);
animSet.setFillAfter(true);
v.clearAnimation();
v.startAnimation(animSet);
}
}
Aggregations