当前位置: 首页>>代码示例>>Java>>正文


Java ScaleAnimation.setDuration方法代码示例

本文整理汇总了Java中android.view.animation.ScaleAnimation.setDuration方法的典型用法代码示例。如果您正苦于以下问题:Java ScaleAnimation.setDuration方法的具体用法?Java ScaleAnimation.setDuration怎么用?Java ScaleAnimation.setDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.animation.ScaleAnimation的用法示例。


在下文中一共展示了ScaleAnimation.setDuration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:sfilmak,项目名称:MakiLite,代码行数:20,代码来源:Fab.java

示例2: doEnterAnim

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
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);
    }
}
 
开发者ID:devilist,项目名称:RecyclerWheelPicker,代码行数:21,代码来源:WheelPicker.java

示例3: 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);
	}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:17,代码来源:ScaleLoadingLayout.java

示例4: onCreate

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@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();
  }
 
开发者ID:qizhenghao,项目名称:HiBangClient,代码行数:37,代码来源:WhatsnewDoor.java

示例5: reloadQuestionnaire

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@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();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:MainActivity.java

示例6: onSizeChanged

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
@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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:RippleView.java

示例7: 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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:FragmentManagerImpl.java

示例8: animationScale

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public static void animationScale(View view, float sizeIn, float sizeOut, int duration) {
  ScaleAnimation scaleAnimation = new ScaleAnimation(sizeIn, sizeOut, sizeIn, sizeOut,
      Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  scaleAnimation.setDuration(duration);
  scaleAnimation.setRepeatMode(Animation.REVERSE);
  scaleAnimation.setRepeatCount(Animation.INFINITE);
  view.startAnimation(scaleAnimation);
}
 
开发者ID:AtlantPlatform,项目名称:atlant-android,代码行数:9,代码来源:AnimationUtils.java

示例9: 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;
}
 
开发者ID:isuhao,项目名称:QMark,代码行数:8,代码来源:WelcomeSnowActy.java

示例10: scale

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
private Animation scale(){
    ScaleAnimation scaleAnimation = new ScaleAnimation(.75F, 1f, .75F, 1f,
            Animation.RELATIVE_TO_SELF, .5F, Animation.RELATIVE_TO_SELF, .5F);
    scaleAnimation.setDuration(BUTTON_ANIMATION_DURATION);
    scaleAnimation.setFillAfter(true);
    return  scaleAnimation;
}
 
开发者ID:amirarcane,项目名称:lock-screen,代码行数:8,代码来源:PinLockAdapter.java

示例11: getLessenScaleAnimation

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:Jusenr,项目名称:androidtools,代码行数:16,代码来源:AnimationUtils.java

示例12: scaleAnimateView

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
public static void scaleAnimateView(View view) {
    ScaleAnimation animation =
            new ScaleAnimation(
                    1.15f, 1, 1.15f, 1,
                    Animation.RELATIVE_TO_SELF, 0.5f,
                    Animation.RELATIVE_TO_SELF, 0.5f);

    view.setAnimation(animation);
    animation.setDuration(100);
    animation.start();
}
 
开发者ID:MindorksOpenSource,项目名称:android-mvvm-architecture,代码行数:12,代码来源:ViewAnimationUtils.java

示例13: 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);
}
 
开发者ID:MBach,项目名称:LeMondeRssReader,代码行数:16,代码来源:ExtendedFabButton.java

示例14: scaleSmallAnim

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
 * 缩小动画
 *
 * @param v view
 */
static void scaleSmallAnim(View v) {
    ScaleAnimation an1 = new ScaleAnimation(1f, 0.8f, 1f, 0.8f,
            Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
    an1.setDuration(200);
    an1.setFillAfter(true);
    v.startAnimation(an1);
}
 
开发者ID:f-evil,项目名称:EVideoRecorder,代码行数:13,代码来源:ERecorderActivityImpl.java

示例15: startScale

import android.view.animation.ScaleAnimation; //导入方法依赖的package包/类
/**
 * scale
 */
private void startScale() {
    ScaleAnimation scale = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f,
            Animation.RELATIVE_TO_SELF, 0.5f);
    scale.setDuration(1000);
    content.startAnimation(scale);
}
 
开发者ID:wuhighway,项目名称:DailyStudy,代码行数:10,代码来源:AnimationDemoActivity.java


注:本文中的android.view.animation.ScaleAnimation.setDuration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。