Code example for GestureDetectorCompat

		init(attrs, defStyle);
	private void init(AttributeSet attrs, int defStyle) {
		// Load attributes (if we have any HA!) 
		detector = new GestureDetectorCompat(getContext(), new GestureListener());
	protected void onDraw(Canvas canvas) {
		// TODO: consider storing these as member variables to reduce 
		// allocations per draw cycle. 
		int paddingLeft = getPaddingLeft();
		int paddingTop = getPaddingTop();
		int paddingRight = getPaddingRight();
		int paddingBottom = getPaddingBottom();
		int contentWidth = getWidth() - paddingLeft - paddingRight;
Experience pair programming with AI  Get Codota for Java