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


Java View.clearAnimation方法代码示例

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


在下文中一共展示了View.clearAnimation方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shake

import android.view.View; //导入方法依赖的package包/类
public static void shake(final View view, final Animator.AnimatorListener listener) {
        view.clearAnimation();
        view.post(new Runnable() {
            @Override
            public void run() {
                view.setPivotX(view.getWidth()/2);
                view.setPivotY(view.getHeight());
                ObjectAnimator shakeAnim = ObjectAnimator.ofFloat(view, "rotation", 0f,-15f,0f, 15f, 0f).setDuration(1200);
//        shakeAnim.setInterpolator(new AccelerateInterpolator());
                if(listener!=null) {
                    shakeAnim.addListener(listener);
                }
                shakeAnim.setStartDelay(500);
                shakeAnim.start();
            }
        });

    }
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:19,代码来源:SavorAnimUtil.java

示例2: startBeatsAnimation

import android.view.View; //导入方法依赖的package包/类
@UiThread public static void startBeatsAnimation(@NonNull View view) {
    view.clearAnimation();
    if (view.getAnimation() != null) {
        view.getAnimation().cancel();
    }
    List<ObjectAnimator> animators = getBeats(view);
    for (ObjectAnimator anim : animators) {
        anim.setDuration(300).start();
        anim.setInterpolator(interpolator);
    }
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:12,代码来源:AnimHelper.java

示例3: clearTarget

import android.view.View; //导入方法依赖的package包/类
private void clearTarget() {
    View view = getTarget();
    int size = this.mTuples.size();
    for (int i = 0; i < size; i++) {
        if (view.getAnimation() == ((Tuple) this.mTuples.get(i)).mAnimation) {
            view.clearAnimation();
        }
    }
    this.mViewRef = null;
    this.mLastMatch = null;
    this.mRunningAnimation = null;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:13,代码来源:StateListAnimator.java

示例4: hide

import android.view.View; //导入方法依赖的package包/类
/**
 * 隐藏指定控件
 *
 * @param v       需要隐藏的控件
 * @param endAnim 结束动画
 */
public final void hide(final View v, Animation endAnim) {
    if (v == null || mView.indexOfChild(v) < 0) return;

    //获得出场动画
    if (endAnim == null) endAnim = getEndAnimation();
    v.clearAnimation();
    //开始出场动画
    v.startAnimation(endAnim);

    //动画结束后移除控件
    mHandler.postDelayed(new Runnable() {
        @Override
        public void run() {
            if (v == null || mView.indexOfChild(v) < 0) return;
            //移除指定控件
            mView.removeView(v);
            //隐藏顶层容器控件
            if (mView.getChildCount() == 1) hideToast();
        }
    }, TIME_END_ANIM);
}
 
开发者ID:jeasinlee,项目名称:AndroidBasicLibs,代码行数:28,代码来源:DrawerToast.java

示例5: slidingToY

import android.view.View; //导入方法依赖的package包/类
public void slidingToY(View view ,float y){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        view.setY(y);
    }else{
        ViewHelper.setY(view, y);
    }
}
 
开发者ID:joelan,项目名称:ClouldReader,代码行数:12,代码来源:Instrument.java

示例6: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(final View v) {

    if (currentLookForWid.getText().equals(" ")) {
        v.startAnimation(notItAnim);
        return;
    }

    String symv = (String)v.getTag();

    TextView wid2 = activeSyms.get(current);
    if (wid2==null) return;

    String symw = (String)wid2.getTag();

    if (symv.equals(symw)) {

        Log.d("Doda", "Found " + symv.codePointAt(0));
        v.setAlpha(.6f);
        v.startAnimation(wasItAnim);


        final ImageView blow = new ImageView(this);
        blow.setBackgroundResource(R.drawable.explosion);

        Point location = symPoints.get((TextView)v);
        float fac = 1.25f;

        score += Math.max(100, 5000 - (System.currentTimeMillis() - findTime)) * (backgroundImage?1.5:1);

        int msize = spToPx((int)(mMode.getMaxIconSize(bsize)*fac));
        FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(msize, msize);
        lp.setMargins(location.x - (int)(mMode.getMaxIconSize(bsize)*fac/2), location.y - (int)(mMode.getMaxIconSize(bsize)*fac/2), 0, 0);
        lp.gravity = Gravity.START | Gravity.TOP;


        blow.setLayoutParams(lp);
        mSoundEffects.playPlode();

        v.clearAnimation();

        mMainScreen.removeView(v);
        activeSyms.set(current, null);
        mMainScreen.addView(blow);

        AnimationDrawable ad = ((AnimationDrawable) blow.getBackground());
        int time = ad.getNumberOfFrames() * ad.getDuration(0);
        ad.start();
        showNext(false);

        mMainScreen.postDelayed(new Runnable() {
            @Override
            public void run() {
                mMainScreen.removeView(blow);
            }
        }, time + 20);

    } else {

        v.startAnimation(notItAnim);
        if (mMode.isTimed()) {
            startTime -= 5000;
            showMessage(getString(R.string.miss_penalty));
        }

    }

}
 
开发者ID:quaap,项目名称:DodaTheExploda,代码行数:69,代码来源:MainActivity.java

示例7: transition

import android.view.View; //导入方法依赖的package包/类
/**
 * Always clears the current animation on the view using
 * {@link android.view.View#clearAnimation()}, then starts the
 * {@link android.view.animation.Animation} given in the constructor using
 * {@link android.view.View#startAnimation(android.view.animation.Animation)} and then returns
 * {@code false} because the animation does not actually put the current resource on the view.
 *
 * @param current {@inheritDoc}
 * @param adapter {@inheritDoc}
 * @return {@inheritDoc}
 */
@Override
public boolean transition(R current, ViewAdapter adapter) {
  View view = adapter.getView();
  if (view != null) {
    view.clearAnimation();
    Animation animation = viewTransitionAnimationFactory.build(view.getContext());
    view.startAnimation(animation);
  }

  return false;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:23,代码来源:ViewTransition.java

示例8: slidingByDelta

import android.view.View; //导入方法依赖的package包/类
public void slidingByDelta(View view ,float delta){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        view.setTranslationY(delta);
    }else{
        ViewHelper.setTranslationY(view, delta);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:Instrument.java

示例9: itemDidDisappear

import android.view.View; //导入方法依赖的package包/类
private void itemDidDisappear() {
	final int itemCount = mRayLayout.getChildCount();
	for (int i = 0; i < itemCount; i++) {
		View item = mRayLayout.getChildAt(i);
		item.clearAnimation();
	}

	mRayLayout.switchState(false);
}
 
开发者ID:leobert-lan,项目名称:UiLib,代码行数:10,代码来源:RayMenu.java

示例10: reset

import android.view.View; //导入方法依赖的package包/类
public void reset(View view, long duration){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        android.animation.ObjectAnimator.ofFloat(view, "translationY", 0F).setDuration(duration).start();
    }else{
        com.nineoldandroids.animation.ObjectAnimator.ofFloat(view, "translationY", 0F).setDuration(duration).start();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:Instrument.java

示例11: smoothTo

import android.view.View; //导入方法依赖的package包/类
public void smoothTo(View view ,float y, long duration){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        android.animation.ObjectAnimator.ofFloat(view, "translationY", y).setDuration(duration).start();
    }else{
        com.nineoldandroids.animation.ObjectAnimator.ofFloat(view, "translationY", y).setDuration(duration).start();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:Instrument.java

示例12: displayAnim

import android.view.View; //导入方法依赖的package包/类
public static void displayAnim(View view, Context context, int animId, int targetVisibility){
    view.clearAnimation();
    Animation anim =
            android.view.animation.AnimationUtils.loadAnimation(context, animId);
    view.setVisibility(targetVisibility);
    view.startAnimation(anim);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:8,代码来源:AnimationUtils.java

示例13: slidingByDelta

import android.view.View; //导入方法依赖的package包/类
public void slidingByDelta(View view ,float delta){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        view.setTranslationY(delta);
    }else{
       // ViewHelper.setTranslationY(view, delta);
    }
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:12,代码来源:Instrument.java

示例14: slidingToY

import android.view.View; //导入方法依赖的package包/类
public void slidingToY(View view ,float y){
    if(view == null){
        return;
    }
    view.clearAnimation();
    if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
        view.setY(y);
    }else{
        //ViewHelper.setY(view, y);
    }
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:12,代码来源:Instrument.java

示例15: animateIn

import android.view.View; //导入方法依赖的package包/类
public static void animateIn(final @NonNull View view, final @NonNull Animation animation) {
  if (view.getVisibility() == View.VISIBLE) return;

  view.clearAnimation();
  animation.reset();
  animation.setStartTime(0);
  view.setVisibility(View.VISIBLE);
  view.startAnimation(animation);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:10,代码来源:ViewUtil.java


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