修复偶现的崩溃问题
This commit is contained in:
@@ -437,5 +437,10 @@ val Context.bookshelfLayoutGrid: Int
|
||||
fun Context.themeColor(attr: Int): Int {
|
||||
val typedValue = TypedValue()
|
||||
theme.resolveAttribute(attr, typedValue, true)
|
||||
return ContextCompat.getColor(this, typedValue.resourceId)
|
||||
return if (typedValue.resourceId != 0) {
|
||||
ContextCompat.getColor(this, typedValue.resourceId)
|
||||
} else {
|
||||
typedValue.data
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user