本文整理汇总了Java中android.view.animation.ScaleAnimation.setInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleAnimation.setInterpolator方法的具体用法?Java ScaleAnimation.setInterpolator怎么用?Java ScaleAnimation.setInterpolator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.animation.ScaleAnimation
的用法示例。
在下文中一共展示了ScaleAnimation.setInterpolator方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hide
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* Hides the FAB.
*/
@Override
public void hide() {
// Only use scale animation if FAB is visible
if (getVisibility() == View.VISIBLE) {
// Pivots indicate where the animation begins from
float pivotX = getPivotX() + getTranslationX();
float pivotY = getPivotY() + getTranslationY();
// Animate FAB shrinking
ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, pivotX, pivotY);
anim.setDuration(FAB_ANIM_DURATION);
anim.setInterpolator(getInterpolator());
startAnimation(anim);
}
setVisibility(View.INVISIBLE);
}
示例2: ScaleLoadingLayout
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public ScaleLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
super(context, mode, scrollDirection, attrs);
/**创建缩放动画动画*/
mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
// mContentLayout.setSca(ScaleType.MATRIX);
// mHeaderImageMatrix = new Matrix();
// mHeaderImage.setImageMatrix(mHeaderImageMatrix);
mScalAnimation = new ScaleAnimation(BASE_SCALE, 1, Animation.RELATIVE_TO_SELF, BASE_SCALE, Animation.RELATIVE_TO_SELF,
1);
mScalAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mScalAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mScalAnimation.setRepeatCount(Animation.INFINITE);
mScalAnimation.setRepeatMode(Animation.RESTART);
}
示例3: startScale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private ScaleAnimation startScale() {
ScaleAnimation scale = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setInterpolator(this, android.R.anim.accelerate_interpolator);
scale.setStartOffset(0);
scale.setDuration(1500);
return scale;
}
示例4: endScale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private ScaleAnimation endScale(int startTime) {
ScaleAnimation scale = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setInterpolator(this, android.R.anim.decelerate_interpolator);
scale.setStartOffset(startTime - 300);
scale.setDuration(300);
return scale;
}
示例5: makeOpenCloseAnimation
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
static Animation makeOpenCloseAnimation(Context context, float startScale, float endScale, float startAlpha, float endAlpha) {
AnimationSet set = new AnimationSet(false);
ScaleAnimation scale = new ScaleAnimation(startScale, endScale, startScale, endScale, 1, 0.5f, 1, 0.5f);
scale.setInterpolator(DECELERATE_QUINT);
scale.setDuration(220);
set.addAnimation(scale);
AlphaAnimation alpha = new AlphaAnimation(startAlpha, endAlpha);
alpha.setInterpolator(DECELERATE_CUBIC);
alpha.setDuration(220);
set.addAnimation(alpha);
return set;
}
示例6: onButtonPressed
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private static void onButtonPressed(View button) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1, 0.9f,
1, 0.9f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(100);
scaleAnimation.setFillAfter(true);
button.startAnimation(scaleAnimation);
}
示例7: onButtonReleased
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private static void onButtonReleased(View button) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.9f, 1f,
0.9f, 1f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(100);
scaleAnimation.setFillAfter(true);
button.startAnimation(scaleAnimation);
}
示例8: getAnimationSetScaleBig
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* 放大动画
*
* @return
*/
public static AnimationSet getAnimationSetScaleBig() {
AnimationSet animationSet = new AnimationSet(true);
ScaleAnimation scaleAnimation = new ScaleAnimation(0.1f, 1.0f, 0.1f, 1.0f, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(400);
animationSet.addAnimation(scaleAnimation);
animationSet.setDuration(400);
return animationSet;
}
示例9: getAnimationSetScaleNarrow
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
* 缩小动画
*
* @return
*/
public static AnimationSet getAnimationSetScaleNarrow() {
AnimationSet animationSet = new AnimationSet(true);
ScaleAnimation scaleAnimation = new ScaleAnimation(2.1f, 1.0f, 2.1f, 1.0f, RELATIVE_TO_SELF, 0.5f, RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setInterpolator(new DecelerateInterpolator());
scaleAnimation.setDuration(400);
animationSet.addAnimation(scaleAnimation);
animationSet.setDuration(400);
return animationSet;
}
示例10: hide
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public void hide() {
// Only use scale animation if FAB is visible
if (getVisibility() == View.VISIBLE) {
// Pivots indicate where the animation begins from
float pivotX = getPivotX() + getTranslationX();
float pivotY = getPivotY() + getTranslationY();
// Animate FAB shrinking
ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, pivotX, pivotY);
anim.setDuration(FAB_ANIM_DURATION);
anim.setInterpolator(getInterpolator());
startAnimation(anim);
}
setVisibility(View.INVISIBLE);
}
示例11: scale
import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private void scale(View v) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1, 1, 1, 0.9f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
1.2f);
scaleAnimation.setRepeatMode(Animation.REVERSE);
scaleAnimation.setInterpolator(new AccelerateInterpolator());
scaleAnimation.setDuration(150);
scaleAnimation.setRepeatCount(-1);
v.startAnimation(scaleAnimation);
}