I am creating a POC on how to resize an imageView in android. I want to put 4 squares in the corner of the ImageView so I can drag the squares to resize. What should I use to get this result?

Canvas.drawRect(float left, float top, float right, float bottom, Paint paint)The class (suppose it is an Activity) should implements OnTouchListener, and register the listener to itself
public class MyActivity extends Activity implements OnTouchListener {
...
setOnTouchListener(MyActivity.this);
...
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getActionMasked();
switch(action) {
case MotionEvent.ACTION_DOWN:
break;
case MotionEvent.ACTION_MOVE:
break;
case MotionEvent.ACTION_UP:
// Get the coordinates
int x = (int)event.getRawX();
int y = (int)event.getRawY();
// Resize the imageView
resize();
break;
case MotionEvent.ACTION_CANCEL:
break;
}
return true;
}
}
You can use ImageView.setMaxHeight(), ImageView.setMaxWidth() to resize the imageview
By the way, does the imageView you want to resize is in fact an image? In that case, using drawable might be a better idea
Maybe an overlay is what you need. Create a 9-patch drawable with the squares and corners and put that layer on top of your imageview.