Code example for AlphaAnimation

Methods: setDuration, setFillAfter

0
	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);
		} 
	} 
	 
	@Override 
	protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
		for (int i=0; i<getChildCount(); i++) {
			View child = getChildAt(i);
			int childLeft = child.getLeft();
			int childTop = child.getTop();
			int childRight = child.getMeasuredWidth() + childLeft;
			int childBottom = child.getMeasuredHeight() + childTop;
			child.layout(childLeft, childTop, childRight, childBottom);