I'm currently using the library TouchImageView here:
https://github.com/MikeOrtiz/TouchImageView
This works perfectly fine when I fill the entire phone's screen with the TouchImageView, but how would I constrain the visible area to a square?
I've tried:
public class SquareTouchImageView extends TouchImageView {
public SquareTouchImageView(Context context) {
super(context);
// TODO Auto-generated constructor stub
}
public SquareTouchImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SquareTouchImageView(Context context, AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
int width = getMeasuredWidth();
setMeasuredDimension(width, width);
}
}
But that doesn't let me scroll down to show the rest of the image (if it's taller than it is wide)
Is there a way I can enable a square TouchImageView?
If so how would I be able to do it?