Code example for AlphaAnimation

Methods: setDuration, setFillAfter

0
	private void enableActiveChild() { 
		if (getChildCount() > 0) {
			DraggableView previousViewWithFocus = getActiveDraggableView();
			Log.i("AndroidHack", "setting active view to  be touchable");
			previousViewWithFocus.setIsTouchable(true);
			AlphaAnimation anim = new AlphaAnimation(0.5f, previousViewWithFocus.getAlpha());
			anim.setFillAfter(true);
			anim.setDuration(1000);
			previousViewWithFocus.startAnimation(anim);
		} 
	} 
	 
	private void disableActiveChild() { 
		if (getChildCount() > 0) {
			DraggableView previousViewWithFocus = getActiveDraggableView();
			Log.i("AndroidHack", "setting active view to not be touchable");
			previousViewWithFocus.setIsTouchable(false);
			AlphaAnimation anim = new AlphaAnimation(previousViewWithFocus.getAlpha(), 0.5f);
			anim.setFillAfter(true);
			anim.setDuration(1000);
			previousViewWithFocus.startAnimation(anim);