mobile/android/base/widget/SquaredImageView.java

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 package org.mozilla.gecko.widget;
     3 import android.content.Context;
     4 import android.util.AttributeSet;
     5 import android.widget.ImageView;
     7 final class SquaredImageView extends ImageView {
     8     public SquaredImageView(Context context) {
     9         super(context);
    10     }
    12     public SquaredImageView(Context context, AttributeSet attrs) {
    13         super(context, attrs);
    14     }
    16     @Override
    17     protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    18         super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    19         setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth());
    20     }
    21 }

mercurial