blob: 09048e33bd142ebc77da220b7f05a56170a1043b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package org.lineageos.eleven.widgets;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
public class SquareFrame extends FrameLayout {
public SquareFrame(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public void onMeasure(final int widthSpec, final int heightSpec) {
super.onMeasure(widthSpec, heightSpec);
final int mSize = Math.min(getMeasuredWidth(), getMeasuredHeight());
setMeasuredDimension(mSize, mSize);
}
}
|