Do not use OnClickListener, but OnTouchListener and handle the click area yourself.
For example, by scaling a touch rectangle and moving it to the center of the view. You can also use radius or manual offsets.
imageView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { final Rect rect = new Rect(); v.getHitRect(rect); float scale = 0.5f; final float x = event.getX(); final float y = event.getY(); final float minX = v.getWidth() * 0.5f * (1.0f - scale); final float maxX = v.getWidth() * 0.5f * (1.0f + scale); final float minY = v.getHeight() * 0.5f * (1.0f - scale); final float maxY = v.getHeight() * 0.5f * (1.0f + scale); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: if (x > minX && x < maxX && y > minY && y < maxY) { Log.d("TOUCH", String.valueOf(x) + " " + String.valueOf(y)); } break; } return true; } });
source share