Code example for ViewParent

Methods: getParent

0
	public ViewGroup getParentFliper(View view) {
		if (view.getParent() instanceof SmoothFliperView) {
			return (ViewGroup) view.getParent();
		} else { 
			ViewParent parentView = view.getParent();
			if (parentView != null && parentView.getParent() == null)
				return null; 
			else 
				return getParentFliper((View) parentView);
		} 
 
	} 
 
	private void snapToDestination() { 
		final int screenWidth = getWidth();
		final int whichScreen = (getScrollX() + (screenWidth / 2))
				/ screenWidth;
 
		snapToScreen(whichScreen);
	}