package fishrungames.bashgid;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

public class SquareImageView extends ImageView {

public SquareImageView(final Context context) {
    super(context);
}

public SquareImageView(final Context context, final AttributeSet attrs) {
    super(context, attrs);
}

public SquareImageView(final Context context, final AttributeSet attrs,
        final int defStyle) {
    super(context, attrs, defStyle);
}

@Override
protected void onMeasure(int width, int height) {
    super.onMeasure(width, height);
    int measuredWidth = getMeasuredWidth();
    //int measuredHeight = getMeasuredHeight();
    
    setMeasuredDimension(measuredWidth, measuredWidth);
    
    /*if (measuredWidth > measuredHeight) {
        setMeasuredDimension(measuredHeight, measuredHeight);
    } else {
        setMeasuredDimension(measuredWidth, measuredWidth);
    }*/
}


}