修复偶现的崩溃问题
This commit is contained in:
@@ -437,5 +437,10 @@ val Context.bookshelfLayoutGrid: Int
|
|||||||
fun Context.themeColor(attr: Int): Int {
|
fun Context.themeColor(attr: Int): Int {
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
theme.resolveAttribute(attr, typedValue, true)
|
theme.resolveAttribute(attr, typedValue, true)
|
||||||
return ContextCompat.getColor(this, typedValue.resourceId)
|
return if (typedValue.resourceId != 0) {
|
||||||
|
ContextCompat.getColor(this, typedValue.resourceId)
|
||||||
|
} else {
|
||||||
|
typedValue.data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ThemeOverlay.PureBlack" parent="">
|
<style name="ThemeOverlay.PureBlack" parent="">
|
||||||
<item name="android:colorBackground">#000000</item>
|
<item name="android:colorBackground">@color/black</item>
|
||||||
<item name="colorSurface">#000000</item>
|
<item name="colorSurface">@color/black</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user