private AnimationSet startHideContinueIconAnimations() {
Animation mScaleAnimation = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
Animation mRotateAnimation = new RotateAnimation(
0, 360,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
);
mRotateAnimation.setRepeatCount(0);
AnimationSet mAnimations = new AnimationSet(true);
mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
mAnimations.setFillAfter(true);
mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
mAnimations.addAnimation(mScaleAnimation);
mAnimations.addAnimation(mRotateAnimation);
mContinueIcon.startAnimation(mAnimations);
return mAnimations;
}
java类android.view.animation.ScaleAnimation的实例源码
WelcomeActivity.java 文件源码
项目:Pocket-Plays-for-Twitch
阅读 36
收藏 0
点赞 0
评论 0
ExpandButtonLayout.java 文件源码
项目:ExpandButton
阅读 34
收藏 0
点赞 0
评论 0
public void open() {
AnimationSet animationSet = new AnimationSet(true);
animationSet.setDuration(duration);
animationSet.setAnimationListener(this);
animationSet.setFillAfter(true);
RotateAnimation rotateAnimation = new RotateAnimation(270, 360,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animationSet.addAnimation(rotateAnimation);
Animation scaleAnimation = new ScaleAnimation(1.25f, 1f, 1.25f, 1f,
ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
animationSet.addAnimation(scaleAnimation);
imageView.startAnimation(animationSet);
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator animator1 = ObjectAnimator.ofInt(mLinearLayout, "width", 0, mLinearLayoutWidth);
ObjectAnimator animator2 = ObjectAnimator.ofInt(mLinearLayout, "paddingLeft", 0, savePaddingLeft);
ObjectAnimator animator3 = ObjectAnimator.ofInt(mLinearLayout, "paddingRight", 0, savePaddingRight);
ObjectAnimator animator4 = ObjectAnimator.ofInt(mLinearLayout, "marginLeft", 0, saveMarginLeft);
ObjectAnimator animator5 = ObjectAnimator.ofInt(mLinearLayout, "marginRight", 0, saveMarginRight);
animatorSet.playTogether(animator1, animator2, animator3, animator4, animator5);
animatorSet.setDuration(duration).start();
}
ShowroomActivity.java 文件源码
项目:showroom-android
阅读 35
收藏 0
点赞 0
评论 0
private void bindHelpButton() {
titleHelpButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ScaleAnimation bounce = new ScaleAnimation(1.2f, 1f, 1.2f, 1, helpButtonSizePx / 2, helpButtonSizePx / 2);
bounce.setDuration(600);
bounce.setInterpolator(new BounceInterpolator());
if (helpLayout.getVisibility() == View.GONE) {
showHelpOverlay();
titleHelpButton.setBackgroundResource(R.drawable.sr_close_icon);
titleHelpButton.startAnimation(bounce);
} else {
hideHelpOverlay();
titleHelpButton.setBackgroundResource(R.drawable.sr_info_icon);
titleHelpButton.startAnimation(bounce);
}
}
});
}
SimpleAnimUtil.java 文件源码
项目:GitHub
阅读 29
收藏 0
点赞 0
评论 0
/**
* 生成ScaleAnimation
*
* time=300
*/
public static Animation getScaleAnimation(float fromX,
float toX,
float fromY,
float toY,
int pivotXType,
float pivotXValue,
int pivotYType,
float pivotYValue) {
Animation scaleAnimation = new ScaleAnimation(fromX, toX, fromY, toY, pivotXType, pivotXValue, pivotYType,
pivotYValue
);
scaleAnimation.setDuration(300);
scaleAnimation.setFillEnabled(true);
scaleAnimation.setFillAfter(true);
return scaleAnimation;
}
Fab.java 文件源码
项目:MakiLite
阅读 27
收藏 0
点赞 0
评论 0
/**
* 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);
}
MicrophoneRecorderView.java 文件源码
项目:PeSanKita-android
阅读 37
收藏 0
点赞 0
评论 0
public void display(float x) {
this.startPositionX = x;
this.lastPositionX = x;
recordButtonFab.setVisibility(View.VISIBLE);
float translation = ViewCompat.getLayoutDirection(recordButtonFab) ==
ViewCompat.LAYOUT_DIRECTION_LTR ? -.25f : .25f;
AnimationSet animation = new AnimationSet(true);
animation.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, translation,
Animation.RELATIVE_TO_SELF, translation,
Animation.RELATIVE_TO_SELF, -.25f,
Animation.RELATIVE_TO_SELF, -.25f));
animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
Animation.RELATIVE_TO_SELF, .5f,
Animation.RELATIVE_TO_SELF, .5f));
animation.setFillBefore(true);
animation.setFillAfter(true);
animation.setDuration(ANIMATION_DURATION);
animation.setInterpolator(new OvershootInterpolator());
recordButtonFab.startAnimation(animation);
}
WheelPicker.java 文件源码
项目:RecyclerWheelPicker
阅读 34
收藏 0
点赞 0
评论 0
public void doEnterAnim(final View contentView, long animDuration) {
if (builder.gravity == Gravity.BOTTOM) {
ValueAnimator enterAnimator = ValueAnimator.ofFloat(contentView.getHeight(), 0);
enterAnimator.setDuration(animDuration);
enterAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
contentView.setTranslationY(value);
}
});
enterAnimator.start();
} else {
ScaleAnimation scaleAnimation = new ScaleAnimation(0F, 1.0F, 0F, 1.0F,
Animation.RELATIVE_TO_PARENT, 0.5F, Animation.RELATIVE_TO_PARENT, 0.5F);
scaleAnimation.setDuration(animDuration);
scaleAnimation.setFillAfter(true);
contentView.startAnimation(scaleAnimation);
}
}
WheelPicker.java 文件源码
项目:RecyclerWheelPicker
阅读 31
收藏 0
点赞 0
评论 0
public void doExitAnim(final View contentView, long animDuration) {
if (builder.gravity == Gravity.BOTTOM) {
ValueAnimator exitAnimator = ValueAnimator.ofFloat(0, contentView.getHeight());
exitAnimator.setDuration(animDuration);
exitAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
contentView.setTranslationY(value);
}
});
exitAnimator.start();
} else {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0F, 0.0F, 1.0F, 0.0F,
Animation.RELATIVE_TO_PARENT, 0.5F, Animation.RELATIVE_TO_PARENT, 0.5F);
scaleAnimation.setDuration(animDuration);
scaleAnimation.setFillAfter(true);
contentView.startAnimation(scaleAnimation);
}
}
ScaleLoadingLayout.java 文件源码
项目:Hotspot-master-devp
阅读 28
收藏 0
点赞 0
评论 0
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);
}
WhatsnewDoor.java 文件源码
项目:HiBangClient
阅读 25
收藏 0
点赞 0
评论 0
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.whats_door);
mLeft = (ImageView)findViewById(R.id.imageLeft);
mRight = (ImageView)findViewById(R.id.imageRight);
mText = (TextView)findViewById(R.id.anim_text);
AnimationSet anim = new AnimationSet(true);
TranslateAnimation mytranslateanim = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,-1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim.setDuration(2000);
anim.setStartOffset(800);
anim.addAnimation(mytranslateanim);
anim.setFillAfter(true);
mLeft.startAnimation(anim);
AnimationSet anim1 = new AnimationSet(true);
TranslateAnimation mytranslateanim1 = new TranslateAnimation(Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,+1f,Animation.RELATIVE_TO_SELF,0f,Animation.RELATIVE_TO_SELF,0f);
mytranslateanim1.setDuration(1500);
anim1.addAnimation(mytranslateanim1);
anim1.setStartOffset(800);
anim1.setFillAfter(true);
mRight.startAnimation(anim1);
AnimationSet anim2 = new AnimationSet(true);
ScaleAnimation myscaleanim = new ScaleAnimation(1f,3f,1f,3f,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
myscaleanim.setDuration(1000);
AlphaAnimation myalphaanim = new AlphaAnimation(1,0.0001f);
myalphaanim.setDuration(1500);
anim2.addAnimation(myscaleanim);
anim2.addAnimation(myalphaanim);
anim2.setFillAfter(true);
mText.startAnimation(anim2);
new Thread(this).start();
}
Fab.java 文件源码
项目:fussroll
阅读 25
收藏 0
点赞 0
评论 0
/**
* 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);
}
BaseSensorFragment.java 文件源码
项目:OSchina_resources_android
阅读 37
收藏 0
点赞 0
评论 0
protected void onSuccess() {
mCardView.removeAllViews();
MediaPlayer.create(mContext, R.raw.shake).start();
initShakeView();
mCardView.addView(mShakeView);
mCardView.setVisibility(View.VISIBLE);
ScaleAnimation animation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setDuration(320);
animation.setFillAfter(true);
mCardView.startAnimation(animation);
mLoadingView.stop();
mLoadingView.setVisibility(View.GONE);
mTvState.setVisibility(View.GONE);
}
WelcomeActivity.java 文件源码
项目:Pocket-Plays-for-Twitch
阅读 29
收藏 0
点赞 0
评论 0
private AnimationSet startShowContinueIconAnimations() {
Animation mScaleAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
Animation mRotateAnimation = new RotateAnimation(
0, 360,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
);
mRotateAnimation.setRepeatCount(0);
AnimationSet mAnimations = new AnimationSet(true);
mAnimations.setDuration(REVEAL_ANIMATION_DURATION);
mAnimations.setFillAfter(true);
mAnimations.setInterpolator(new OvershootInterpolator(1.5f));
mAnimations.addAnimation(mScaleAnimation);
mAnimations.addAnimation(mRotateAnimation);
mContinueIcon.startAnimation(mAnimations);
return mAnimations;
}
ExpandButtonLayout.java 文件源码
项目:ExpandButton
阅读 29
收藏 0
点赞 0
评论 0
public void close() {
AnimationSet animationSet = new AnimationSet(true);
animationSet.setDuration(duration);
animationSet.setAnimationListener(this);
animationSet.setFillAfter(true);
RotateAnimation rotateAnimation = new RotateAnimation(360, 270,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animationSet.addAnimation(rotateAnimation);
Animation scaleAnimation = new ScaleAnimation(1f, 1.25f, 1f, 1.25f,
ScaleAnimation.RELATIVE_TO_SELF, 0.5f, ScaleAnimation.RELATIVE_TO_SELF, 0.5f);
animationSet.addAnimation(scaleAnimation);
imageView.startAnimation(animationSet);
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator animator1 = ObjectAnimator.ofInt(mLinearLayout, "width", mLinearLayoutWidth, 0);
ObjectAnimator animator2 = ObjectAnimator.ofInt(mLinearLayout, "paddingLeft", savePaddingLeft, 0);
ObjectAnimator animator3 = ObjectAnimator.ofInt(mLinearLayout, "paddingRight", savePaddingRight, 0);
ObjectAnimator animator4 = ObjectAnimator.ofInt(mLinearLayout, "marginLeft", saveMarginLeft, 0);
ObjectAnimator animator5 = ObjectAnimator.ofInt(mLinearLayout, "marginRight", saveMarginRight, 0);
animatorSet.playTogether(animator1, animator2, animator3, animator4, animator5);
animatorSet.setDuration(duration).start();
}
AtFab.java 文件源码
项目:AstronomyTourPadova
阅读 24
收藏 0
点赞 0
评论 0
/**
* 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);
}
Fab.java 文件源码
项目:FindX
阅读 28
收藏 0
点赞 0
评论 0
/**
* 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);
}
WebActivity.java 文件源码
项目:Floo
阅读 38
收藏 0
点赞 0
评论 0
@Override
@SuppressLint("SetJavaScriptEnabled")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_web);
WebView webView = (WebView) findViewById(R.id.web_view);
String url = getIntent().getStringExtra(URL);
if (url == null && getIntent().getData() != null) {
url = getIntent().getData().getQueryParameter(URL);
}
if (url == null) {
finish();
}
webView.setWebViewClient(new InnerWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
loading = (TextView) findViewById(R.id.loading);
Animation animation = new ScaleAnimation(1.0f, 1.2f, 1.0f, 1.2f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
animation.setRepeatMode(Animation.REVERSE);
animation.setRepeatCount(Animation.INFINITE);
animation.setDuration(500);
loading.startAnimation(animation);
setTitle(url);
}
MicrophoneRecorderView.java 文件源码
项目:Cable-Android
阅读 30
收藏 0
点赞 0
评论 0
public void display(float x) {
this.startPositionX = x;
this.lastPositionX = x;
recordButtonFab.setVisibility(View.VISIBLE);
float translation = ViewCompat.getLayoutDirection(recordButtonFab) ==
ViewCompat.LAYOUT_DIRECTION_LTR ? -.25f : .25f;
AnimationSet animation = new AnimationSet(true);
animation.addAnimation(new TranslateAnimation(Animation.RELATIVE_TO_SELF, translation,
Animation.RELATIVE_TO_SELF, translation,
Animation.RELATIVE_TO_SELF, -.25f,
Animation.RELATIVE_TO_SELF, -.25f));
animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
Animation.RELATIVE_TO_SELF, .5f,
Animation.RELATIVE_TO_SELF, .5f));
animation.setFillBefore(true);
animation.setFillAfter(true);
animation.setDuration(ANIMATION_DURATION);
animation.setInterpolator(new OvershootInterpolator());
recordButtonFab.startAnimation(animation);
}
BottomMenu.java 文件源码
项目:BottomMenu
阅读 29
收藏 0
点赞 0
评论 0
private Animation scaleSmallAnim(int duration, final View child) {
AnimationSet animationSet = new AnimationSet(true);
ScaleAnimation scaleAnim = new ScaleAnimation(1.0f, 0.0f, 1.0f, 0.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
AlphaAnimation alphaAnim = new AlphaAnimation(1f, 0.0f);
alphaAnim.setFillAfter(true);
animationSet.addAnimation(scaleAnim);
animationSet.addAnimation(alphaAnim);
animationSet.setDuration(duration);
return animationSet;
}
RefreshLayout.java 文件源码
项目:RLibrary
阅读 35
收藏 0
点赞 0
评论 0
public void setShowTip(String tip) {
boolean oldShow = mShowTip;
mShowTip = true;
((TextView) mTipView).setText(tip);
if (oldShow) {
mTipView.removeCallbacks(hideTipRunnable);
} else {
mTipView.clearAnimation();
ScaleAnimation scaleAnimation = new ScaleAnimation(0.6f, 1, 1, 1,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scaleAnimation.setDuration(ANIM_TIME);
mTipView.startAnimation(scaleAnimation);
}
mTipView.postDelayed(hideTipRunnable, 1000);
}
MainActivity.java 文件源码
项目:GitHub
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void reloadQuestionnaire(List<Question> questionList) {
refreshQuestionnaire(questionList);
ScaleAnimation animation =
new ScaleAnimation(
1.15f, 1, 1.15f, 1,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
mCardsContainerView.setAnimation(animation);
animation.setDuration(100);
animation.start();
}
RippleView.java 文件源码
项目:GitHub
阅读 27
收藏 0
点赞 0
评论 0
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
WIDTH = w;
HEIGHT = h;
scaleAnimation = new ScaleAnimation(1.0f, zoomScale, 1.0f, zoomScale, w / 2, h / 2);
scaleAnimation.setDuration(zoomDuration);
scaleAnimation.setRepeatMode(Animation.REVERSE);
scaleAnimation.setRepeatCount(1);
}
SimpleAnimUtil.java 文件源码
项目:GitHub
阅读 26
收藏 0
点赞 0
评论 0
/**
* 生成自定义ScaleAnimation
*/
public static Animation getDefaultScaleAnimation() {
Animation scaleAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f
);
scaleAnimation.setDuration(300);
scaleAnimation.setInterpolator(new AccelerateInterpolator());
scaleAnimation.setFillEnabled(true);
scaleAnimation.setFillAfter(true);
return scaleAnimation;
}
WelcomeSnowActy.java 文件源码
项目:QMark
阅读 32
收藏 0
点赞 0
评论 0
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;
}
WelcomeSnowActy.java 文件源码
项目:QMark
阅读 28
收藏 0
点赞 0
评论 0
private ScaleAnimation randomScale() {
float scaleTo = (float) (0.3f + Math.random() * 0.5f);
ScaleAnimation scale = new ScaleAnimation(1, scaleTo, 1, scaleTo, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
scale.setRepeatCount(Animation.INFINITE);
scale.setRepeatMode(Animation.REVERSE);
scale.setStartOffset(1000);
scale.setDuration((int) (Math.random() * 3000) + 1000);
return scale;
}
WelcomeSnowActy.java 文件源码
项目:QMark
阅读 31
收藏 0
点赞 0
评论 0
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;
}
bilibili.java 文件源码
项目:stynico
阅读 26
收藏 0
点赞 0
评论 0
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh)
{
super.onSizeChanged(w, h, oldw, oldh);
WIDTH = w;
HEIGHT = h;
scaleAnimation = new ScaleAnimation(1.0f, zoomScale, 1.0f, zoomScale, w / 2, h / 2);
scaleAnimation.setDuration(zoomDuration);
scaleAnimation.setRepeatMode(Animation.REVERSE);
scaleAnimation.setRepeatCount(1);
}
AnimationUtils.java 文件源码
项目:androidtools
阅读 31
收藏 0
点赞 0
评论 0
/**
* Get a shrink animation
*
* @param durationMillis duration
* @param animationListener Animation monitor
* @return A shrink animation
*/
public static ScaleAnimation getLessenScaleAnimation(long durationMillis, Animation.AnimationListener animationListener) {
ScaleAnimation scaleAnimation = new ScaleAnimation(1.0f, 0.0f, 1.0f,
0.0f, ScaleAnimation.RELATIVE_TO_SELF,
ScaleAnimation.RELATIVE_TO_SELF);
scaleAnimation.setDuration(durationMillis);
scaleAnimation.setAnimationListener(animationListener);
return scaleAnimation;
}
AnimationUtils.java 文件源码
项目:androidtools
阅读 27
收藏 0
点赞 0
评论 0
/**
* Get an enlarged animation
*
* @param durationMillis duration
* @param animationListener Animation monitor
* @return An enlarged animation
*/
public static ScaleAnimation getAmplificationAnimation(long durationMillis, Animation.AnimationListener animationListener) {
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f,
1.0f, ScaleAnimation.RELATIVE_TO_SELF,
ScaleAnimation.RELATIVE_TO_SELF);
scaleAnimation.setDuration(durationMillis);
scaleAnimation.setAnimationListener(animationListener);
return scaleAnimation;
}
MicrophoneRecorderView.java 文件源码
项目:PeSanKita-android
阅读 30
收藏 0
点赞 0
评论 0
public void hide(float x) {
this.lastPositionX = x;
float offset = getOffset(x);
int widthAdjustment = getWidthAdjustment();
AnimationSet animation = new AnimationSet(false);
Animation scaleAnimation = new ScaleAnimation(1, 0.5f, 1, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
Animation translateAnimation = new TranslateAnimation(Animation.ABSOLUTE, offset + widthAdjustment,
Animation.ABSOLUTE, widthAdjustment,
Animation.RELATIVE_TO_SELF, -.25f,
Animation.RELATIVE_TO_SELF, -.25f);
scaleAnimation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
translateAnimation.setInterpolator(new DecelerateInterpolator());
animation.addAnimation(scaleAnimation);
animation.addAnimation(translateAnimation);
animation.setDuration(ANIMATION_DURATION);
animation.setFillBefore(true);
animation.setFillAfter(false);
animation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
recordButtonFab.setVisibility(View.GONE);
recordButtonFab.clearAnimation();
recordButtonFab.startAnimation(animation);
}