自由角度的ImageView,四个角都可定义不同的角度。
SmallImageView最低支持Android5.0(API level 21)
在settings.gradle文件中做如下配置
repositories {
...
maven { url 'https://jitpack.io' }
}
在app目录下的build.gradle文件中做如下配置
dependencies {
implementation 'com.github.NightRainDream:SmallImageView:Latest_VERSION'
}
在layout中引入如下View:
<com.night.image.SmallImageView
android:layout_width="100dp"
android:layout_height="100dp"
app:customRadius="10dp" />
/**
* 设置圆角直径
*
* @param radius 圆角直径
*/
public void setRadius(final float radius)
/**
* 设置圆角直径
*
* @param topLeft 左上角圆角直径
* @param topRight 右上角圆角直径
* @param bottomLeft 左下角圆角直径
* @param bottomRight 右下角圆角直径
*/
public void setRadius(final float topLeft, final float topRight, final float bottomLeft, final float bottomRight)

