diff options
author | marcinzelent <zelent.marcin@gmail.com> | 2018-04-19 23:03:13 +0200 |
---|---|---|
committer | marcinzelent <zelent.marcin@gmail.com> | 2018-04-19 23:03:13 +0200 |
commit | 4e6fc4fcdbcc3c75be13b3f8b80c24e4648fe354 (patch) | |
tree | 9588d81ee5e3e470d242f82b015fac6e34d54014 /app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java | |
parent | 7294c6bd32e362b4c0a64cadbf4dd2c191e1ad8e (diff) |
Added details view, improved observations list
Diffstat (limited to 'app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java')
-rw-r--r-- | app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java b/app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java new file mode 100644 index 0000000..ed5dbb7 --- /dev/null +++ b/app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java @@ -0,0 +1,28 @@ +package org.marcinzelent.liberavem; + +import android.content.Context; +import android.util.AttributeSet; + +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); + } + +} |