Code example for AlphaAnimation

Methods: setDurationsetFillAfter

0
	private static void setAlpha(View view, float alphaValue){
		 
    	if(alphaValue == 1){
    		view.clearAnimation();
    	}else{ 
    		AlphaAnimation alpha = new AlphaAnimation(alphaValue, alphaValue);
        	alpha.setDuration(0); // Make animation instant
        	alpha.setFillAfter(true); // Tell it to persist after the animation ends    	
        	view.startAnimation(alpha);
    	} 
		 
	} 
	 
	public static void ensureUIThread(){ 
    	 
    	if(!isUIThread()){ 
    		AQUtility.report(new IllegalStateException("Not UI Thread"));
    	} 
    	 
    } 
Contextual code suggestions in your IDE  Get Codota for Java