mirror of
https://github.com/SimpleMobileTools/Simple-Thank-You.git
synced 2025-02-07 23:28:43 +01:00
update the database, add app_icon_color column
This commit is contained in:
parent
b268187e9b
commit
e604943295
@ -41,7 +41,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:3.19.24'
|
||||
implementation 'com.simplemobiletools:commons:3.19.25'
|
||||
}
|
||||
|
||||
Properties props = new Properties()
|
||||
|
@ -20,7 +20,7 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
|
||||
companion object {
|
||||
private const val DB_NAME = "Commons.db"
|
||||
private const val DB_VERSION = 1
|
||||
private const val DB_VERSION = 2
|
||||
private const val TABLE_NAME = "commons_colors"
|
||||
private const val THEME_ID = 1 // for now we are storing just 1 theme
|
||||
|
||||
@ -29,10 +29,14 @@ class MyContentProviderDbHelper private constructor(private val context: Context
|
||||
|
||||
override fun onCreate(db: SQLiteDatabase) {
|
||||
db.execSQL("CREATE TABLE $TABLE_NAME ($COL_ID INTEGER PRIMARY KEY AUTOINCREMENT, $COL_TEXT_COLOR INTEGER DEFAULT 0, $COL_BACKGROUND_COLOR INTEGER DEFAULT 0," +
|
||||
" $COL_PRIMARY_COLOR INTEGER DEFAULT 0, $COL_LAST_UPDATED_TS INTEGER DEFAULT 0)")
|
||||
" $COL_PRIMARY_COLOR INTEGER DEFAULT 0, $COL_APP_ICON_COLOR INTEGER DEFAULT 0, $COL_LAST_UPDATED_TS INTEGER DEFAULT 0)")
|
||||
}
|
||||
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {}
|
||||
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) {
|
||||
if (oldVersion == 1) {
|
||||
db.execSQL("ALTER TABLE $TABLE_NAME ADD COLUMN $COL_APP_ICON_COLOR INTEGER DEFAULT 0")
|
||||
}
|
||||
}
|
||||
|
||||
private fun insertDefaultTheme() {
|
||||
val resources = context.resources
|
||||
|
Loading…
x
Reference in New Issue
Block a user