Animation cancel - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Animation cancel method.

This code example shows how to use the following methods:cancel, hasEnded
        } 
	} 
 
    private void stopExistingAnimation() { 
        Animation old = imageView.getAnimation();
        if (old != null && !old.hasEnded()) {
            old.cancel();
        } 
    } 
 
    public void setResourceBitmap(Bitmap resourceAsBitmap) {
        imageView.setImageBitmap(resourceAsBitmap);
    } 
 
    public boolean isCorrectUrl(String url) {
		return url.equals(getUrl());
	} 
 
	public int getLoadingResourceId() { 
		return loadingResourceId;
7
CodeRank
This code example shows how to use the following methods:cancel, start
        matcher = newAnimationMatcher(animation);
    } 
 
    @Test 
    public void shouldKnowWhenAnimationIsStarted() throws Exception { 
        animation.start();
        expect(matcher.toHaveStarted()).toBeTrue();
 
        animation.cancel();
        expect(matcher.toHaveStarted()).toBeFalse();
    } 
 
    private <T extends Animation> AnimationMatcher<T, ?> newAnimationMatcher(T value) {
        AnimationMatcher matcher = new AnimationMatcher();
        GreatExpectations.setActual(matcher, value);
        return matcher;
    } 
} 
5
CodeRank
This code example shows how to use the following methods:cancel, getTransformation, setStartTime
        if (mEnterAnimation == null && mExitAnimation == null) {
            return false; 
        } 
 
        if (!mStarted) {
            mEnterAnimation.setStartTime(now);
            mExitAnimation.setStartTime(now);
            mStarted = true;
        } 
 
        mExitTransformation.clear();
        boolean moreExit = false;
        if (mExitAnimation != null) {
            moreExit = mExitAnimation.getTransformation(now, mExitTransformation);
            if (DEBUG) Slog.v(TAG, "Stepped exit: " + mExitTransformation);
            if (!moreExit) {
                if (DEBUG) Slog.v(TAG, "Exit animation done!");
                mExitAnimation.cancel();
                mExitAnimation = null;
                mExitTransformation.clear();

5
CodeRank
This code example shows how to use the following methods:cancel, reset
This code example shows how to use the following methods:cancel
                textView.setBackgroundColor(backgroundColor);
                textView.setText(d.getText());
                if (d.getDisplayMillis() > 0)
                    timer.start(d.getDisplayMillis());
            } catch (NoSuchElementException e) {
                animation.cancel();
            } 
        } 
    } 
 
    /** 
     * Auto clear timer handler 
     * This just automates calling clearText 
     * 
     * @return boolean to indicate if the timer should re-armed 
     */ 
    @Override 
    public boolean HandleTimer() { 
        clearText(); 
        return false; 
3
CodeRank
This code example shows how to use the following methods:cancel
		this.startAnimation(anim);
	} 
 
	public void stopAnim() { 
		if (anim != null) {
			anim.cancel();
		} 
	} 
 
	public PointF getCurrentPosition() {
		if ((anim != null) && (anim.hasStarted()) && (!anim.hasEnded())) {
			Transformation trans = new Transformation();
			anim.getTransformation(AnimationUtils.currentAnimationTimeMillis(),
					trans);
			float val[] = new float[9];
			trans.getMatrix().getValues(val);
			return new PointF(val[Matrix.MTRANS_X], val[Matrix.MTRANS_Y]);
		} 
		return new PointF(0, 0);
	} 
4
CodeRank
This code example shows how to use the following methods:cancel
		this.startAnimation(anim);
	} 
 
	public void stopAnim() { 
		if (anim != null) {
			anim.cancel();
		} 
	} 
 
	public PointF getCurrentPosition() {
		if ((anim != null) && (anim.hasStarted()) && (!anim.hasEnded())) {
			Transformation trans = new Transformation();
			anim.getTransformation(AnimationUtils.currentAnimationTimeMillis(),
					trans);
			float val[] = new float[9];
			trans.getMatrix().getValues(val);
			return new PointF(val[Matrix.MTRANS_X], val[Matrix.MTRANS_Y]);
		} 
		return new PointF(0, 0);
	} 
4
CodeRank
This code example shows how to use the following methods:cancel, hasStarted
	 */ 
	public void stopThread(){ 
		try{ 
			isStop =true;
			if(am1 != null){
				if(am1.hasStarted()){
					am1.cancel();
				} 
			} 
			if(myThread != null){
				if(!myThread.isInterrupted()){
					myThread.interrupt();
				} 
			} 
		}catch(Exception e){
			e.printStackTrace();
		} 
	} 
	 
	Handler handler = new Handler(){
4
CodeRank
This code example shows how to use the following methods:cancel
			public void onAnimationRepeat(Animation animation) {}
 
			public void onAnimationEnd(Animation animation) {
				array.remove(positon);
				adapter.notifyDataSetChanged();
				animation.cancel();
			} 
		}); 
		 
 
		rowView.startAnimation(animation);
 
	} 
} 
4
CodeRank
This code example shows how to use the following methods:cancel
               
            @Override   
            public void onClick(View v) {  
                // TODO Auto-generated method stub   
            	Log.d("button2","2........................");
                translateAnimation.cancel();                        //取消动画执行  
            }     
        });      
    }   
    }   
4
CodeRank

Related Animation cancel Questions & Answers:

cancel Method Overview
Cancel the animation.
See Code Examples for other Android Animation Methods: