Edge-to-edge Code cleanup

This commit is contained in:
Prathamesh More 2021-12-12 17:11:11 +05:30
parent 421dc817a2
commit 5d8ad186d5
13 changed files with 29 additions and 29 deletions

View file

@ -36,7 +36,6 @@ object ATH {
fun setLightNavigationBar(activity: Activity, enabled: Boolean) {
activity.window.apply {
navigationBarColor = Color.TRANSPARENT
WindowInsetsControllerCompat(
this,
decorView

View file

@ -2,6 +2,7 @@ package code.name.monkey.appthemehelper.util
import android.content.Context
import androidx.annotation.AttrRes
import androidx.core.content.res.use
/**
* @author Aidan Follestad (afollestad)
@ -14,11 +15,8 @@ object ATHUtil {
@JvmOverloads
fun resolveColor(context: Context, @AttrRes attr: Int, fallback: Int = 0): Int {
val a = context.theme.obtainStyledAttributes(intArrayOf(attr))
try {
return a.getColor(0, fallback)
} finally {
a.recycle()
context.theme.obtainStyledAttributes(intArrayOf(attr)).use {
return it.getColor(0, fallback)
}
}
}