效果图:
1.添加依赖同时修改版本号minSdkVersion最低23以上
implementation 'com.github.Maolaos:CharPortraitView:v1.0.0'
android {
signingConfigs {
config {
keyAlias 'approval'
keyPassword '123456'
storeFile file('/src/main/keystore/appkey.jks')
storePassword '123456'
}
}
defaultConfig {
applicationId "com.*********"
minSdkVersion 23
....
}
}
2.java代码
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.Gravi