fixing a crash related to Shared Theme navigation bar color fetching
This commit is contained in:
parent
28db8ba25c
commit
b6bce2b2ec
3 changed files with 5 additions and 2 deletions
|
@ -7,7 +7,7 @@ buildscript {
|
|||
propMinSdkVersion = 21
|
||||
propTargetSdkVersion = propCompileSdkVersion
|
||||
propVersionCode = 1
|
||||
propVersionName = '5.18.6'
|
||||
propVersionName = '5.18.7'
|
||||
kotlin_version = '1.3.50'
|
||||
}
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ fun Context.getSharedThemeSync(cursorLoader: CursorLoader): SharedTheme? {
|
|||
val backgroundColor = cursor.getIntValue(COL_BACKGROUND_COLOR)
|
||||
val primaryColor = cursor.getIntValue(COL_PRIMARY_COLOR)
|
||||
val appIconColor = cursor.getIntValue(COL_APP_ICON_COLOR)
|
||||
val navigationBarColor = cursor.getIntValue(COL_NAVIGATION_BAR_COLOR)
|
||||
val navigationBarColor = cursor.getIntValueOrNull(COL_NAVIGATION_BAR_COLOR) ?: INVALID_NAVIGATION_BAR_COLOR
|
||||
val lastUpdatedTS = cursor.getIntValue(COL_LAST_UPDATED_TS)
|
||||
return SharedTheme(textColor, backgroundColor, primaryColor, appIconColor, navigationBarColor, lastUpdatedTS)
|
||||
}
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package com.simplemobiletools.commons.extensions
|
||||
|
||||
import android.database.Cursor
|
||||
import androidx.core.database.getIntOrNull
|
||||
|
||||
fun Cursor.getStringValue(key: String) = getString(getColumnIndex(key))
|
||||
|
||||
fun Cursor.getIntValue(key: String) = getInt(getColumnIndex(key))
|
||||
|
||||
fun Cursor.getIntValueOrNull(key: String) = getIntOrNull(getColumnIndex(key))
|
||||
|
||||
fun Cursor.getLongValue(key: String) = getLong(getColumnIndex(key))
|
||||
|
||||
fun Cursor.getBlobValue(key: String) = getBlob(getColumnIndex(key))
|
||||
|
|
Loading…
Reference in a new issue