Fix light nav support for API 26

This commit is contained in:
moezbhatti
2019-08-27 22:47:07 +02:00
parent 0f96209eca
commit eb151bba55
4 changed files with 20 additions and 4 deletions
@@ -43,6 +43,13 @@ fun Context.resolveThemeAttribute(attributeId: Int, default: Int = 0): Int {
return if (wasResolved) outValue.resourceId else default
}
fun Context.resolveThemeBoolean(attributeId: Int, default: Boolean = false): Boolean {
val outValue = TypedValue()
val wasResolved = theme.resolveAttribute(attributeId, outValue, true)
return if (wasResolved) outValue.data != 0 else default
}
fun Context.resolveThemeColor(attributeId: Int, default: Int = 0): Int {
val outValue = TypedValue()
val wasResolved = theme.resolveAttribute(attributeId, outValue, true)