Update: Rounded Icons

Update: Use ShapeableImageView
This commit is contained in:
LooKeR
2021-10-16 09:47:32 +05:30
parent 649055d7f1
commit 7a36d943c0
15 changed files with 51 additions and 30 deletions

View File

@ -29,6 +29,13 @@ object TypefaceExtra {
val light = Typeface.create("sans-serif-light", Typeface.NORMAL)!!
}
val Number.toPx
get() = TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP,
this.toFloat(),
Resources.getSystem().displayMetrics
)
fun Context.getDrawableCompat(resId: Int): Drawable {
val drawable = if (!Android.sdk(24)) {
val fileName = TypedValue().apply { resources.getValue(resId, this, true) }.string
@ -92,10 +99,6 @@ fun ViewGroup.inflate(layoutResId: Int): View {
return LayoutInflater.from(context).inflate(layoutResId, this, false)
}
fun ImageView.load(uri: String, builder: ImageRequest.Builder.() -> Unit = {}) {
this.load(uri = uri, builder = builder)
}
fun ImageView.load(uri: Uri, builder: ImageRequest.Builder.() -> Unit = {}) {
this.load(uri = uri, builder = builder)
}