I want to draw a border around an image. But I can\'t align the border at the ImageView itself (like it is done mostly) because I translate and scale the image inside of the
Alternatively, put the imageView in a layout of some sort and just set padding:
static class BorderView extends FrameLayout
{
public ImageView imageView;
public BorderView(Context context)
{
super(context);
setLayoutParams(//wrap content)
imageView = new ImageView(context);//set image and so forth
addView(imageView);
}
public void addSelectionBorder()
{
int border = 8;
setPadding(border,border,border,border);
setBackgroundColor(Color.BLUE);
}
public void removeSelectionBorder()
{
int border = 0;
setPadding(border,border,border,border);
setBackgroundColor(Color.BLACK);
}
}