-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquareImageView.java
More file actions
33 lines (24 loc) · 815 Bytes
/
Copy pathSquareImageView.java
File metadata and controls
33 lines (24 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.example.itay.sumika;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by itay on 19/11/17.
*/
public class SquareImageView extends android.support.v7.widget.AppCompatImageView {
public SquareImageView(Context context) {
super(context);
}
public SquareImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public SquareImageView(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);
}
}