diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2016-03-26 11:16:20 -0400 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2016-03-26 11:16:20 -0400 |
commit | 73eb9d6193fa6e04b533952febf5add548b798d1 (patch) | |
tree | d9f4a3e5e3ac30f91353612bb5aece73be4b5bfb /app/src/main/java/de/danoeh/antennapod/view | |
parent | d6bda2e144c57dc878d70aec303467ca51e1f794 (diff) | |
download | AntennaPod-73eb9d6193fa6e04b533952febf5add548b798d1.zip |
fix layout, keep textview visible
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/view')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/view/SquareImageView.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/view/SquareImageView.java b/app/src/main/java/de/danoeh/antennapod/view/SquareImageView.java new file mode 100644 index 000000000..27b6ee2bc --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/view/SquareImageView.java @@ -0,0 +1,32 @@ +package de.danoeh.antennapod.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.ImageView; + +/** + * From http://stackoverflow.com/a/19449488/6839 + */ +public class SquareImageView extends ImageView { + + 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); + } + +}
\ No newline at end of file |