Code example for RelativeLayout

Methods: startAnimation

0
	public boolean onTouchEvent(final MotionEvent ev) {
		switch (ev.getAction()) {
		case MotionEvent.ACTION_UP:
			if (currentState != State.UPDATING) {
				if (currentState == State.RELEASE) {
					header.startAnimation(new ResizeHeaderAnimation(headerHeight));
					startRefreshing(); 
				} else { 
					header.startAnimation(new ResizeHeaderAnimation(0));
				} 
			} else { 
				header.startAnimation(new ResizeHeaderAnimation(headerHeight));
			} 
		case MotionEvent.ACTION_MOVE:
			ev.setAction(MotionEvent.ACTION_CANCEL);
		} 
		return true; 
	} 
 
	/** 
	 * Used to show header when scrolling down.