riku
2020-08-21 0328eab9276e57487eb2cfff31a945a01dd8c73a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package me.nereo.multi_image_selector.view;
 
import android.content.Context;
import android.util.AttributeSet;
 
/** An image view which always remains square with respect to its width. */
class SquaredImageView extends android.support.v7.widget.AppCompatImageView {
  public SquaredImageView(Context context) {
    super(context);
  }
 
  public SquaredImageView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }
 
  @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth());
  }
}