diff --git a/roundedimageview/src/com/makeramen/RoundedDrawable.java b/roundedimageview/src/com/makeramen/RoundedDrawable.java index a189d5a..d384c3b 100644 --- a/roundedimageview/src/com/makeramen/RoundedDrawable.java +++ b/roundedimageview/src/com/makeramen/RoundedDrawable.java @@ -28,7 +28,7 @@ public class RoundedDrawable extends Drawable { private boolean mOval = false; private float mBorderWidth = 0; private ColorStateList mBorderColor = ColorStateList.valueOf(DEFAULT_BORDER_COLOR); - private ScaleType mScaleType = ScaleType.FIT_XY; + private ScaleType mScaleType = ScaleType.FIT_CENTER; public RoundedDrawable(Bitmap bitmap) { @@ -336,7 +336,7 @@ public ScaleType getScaleType() { public RoundedDrawable setScaleType(ScaleType scaleType) { if (scaleType == null) { - scaleType = ScaleType.FIT_XY; + scaleType = ScaleType.FIT_CENTER; } if (mScaleType != scaleType) { mScaleType = scaleType; diff --git a/roundedimageview/src/com/makeramen/RoundedImageView.java b/roundedimageview/src/com/makeramen/RoundedImageView.java index c33d545..80c3dd9 100644 --- a/roundedimageview/src/com/makeramen/RoundedImageView.java +++ b/roundedimageview/src/com/makeramen/RoundedImageView.java @@ -55,6 +55,9 @@ public RoundedImageView(Context context, AttributeSet attrs, int defStyle) { int index = a.getInt(R.styleable.RoundedImageView_android_scaleType, -1); if (index >= 0) { setScaleType(sScaleTypeArray[index]); + } else { + // default scaletype to FIT_CENTER + setScaleType(ScaleType.FIT_CENTER); } mCornerRadius = a.getDimensionPixelSize(R.styleable.RoundedImageView_corner_radius, -1);