From 4e6fc4fcdbcc3c75be13b3f8b80c24e4648fe354 Mon Sep 17 00:00:00 2001 From: marcinzelent Date: Thu, 19 Apr 2018 23:03:13 +0200 Subject: Added details view, improved observations list --- .../marcinzelent/liberavem/SquareImageView.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java (limited to 'app/src/main/java/org/marcinzelent/liberavem/SquareImageView.java') 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); + } + +} -- cgit v1.2.3