|
|
@ -122,7 +122,6 @@ class CircleImageView @JvmOverloads constructor( |
|
|
|
var isInView = false |
|
|
|
var isInView = false |
|
|
|
|
|
|
|
|
|
|
|
init { |
|
|
|
init { |
|
|
|
super.setScaleType(SCALE_TYPE) |
|
|
|
|
|
|
|
val a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView) |
|
|
|
val a = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView) |
|
|
|
mBorderWidth = |
|
|
|
mBorderWidth = |
|
|
|
a.getDimensionPixelSize( |
|
|
|
a.getDimensionPixelSize( |
|
|
@ -160,16 +159,6 @@ class CircleImageView @JvmOverloads constructor( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun getScaleType(): ScaleType { |
|
|
|
|
|
|
|
return SCALE_TYPE |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun setScaleType(scaleType: ScaleType) { |
|
|
|
|
|
|
|
if (scaleType != SCALE_TYPE) { |
|
|
|
|
|
|
|
throw IllegalArgumentException(String.format("ScaleType %s not supported.", scaleType)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun setAdjustViewBounds(adjustViewBounds: Boolean) { |
|
|
|
override fun setAdjustViewBounds(adjustViewBounds: Boolean) { |
|
|
|
if (adjustViewBounds) { |
|
|
|
if (adjustViewBounds) { |
|
|
|
throw IllegalArgumentException("adjustViewBounds not supported.") |
|
|
|
throw IllegalArgumentException("adjustViewBounds not supported.") |
|
|
@ -456,7 +445,6 @@ class CircleImageView @JvmOverloads constructor( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
private val SCALE_TYPE = ScaleType.CENTER_CROP |
|
|
|
|
|
|
|
private val BITMAP_CONFIG = Bitmap.Config.ARGB_8888 |
|
|
|
private val BITMAP_CONFIG = Bitmap.Config.ARGB_8888 |
|
|
|
private const val COLOR_DRAWABLE_DIMENSION = 2 |
|
|
|
private const val COLOR_DRAWABLE_DIMENSION = 2 |
|
|
|
private const val DEFAULT_BORDER_WIDTH = 0 |
|
|
|
private const val DEFAULT_BORDER_WIDTH = 0 |
|
|
|