use the shared BaseSplash activity

This commit is contained in:
tibbi 2017-11-29 18:51:06 +01:00
parent 27cf585f24
commit 5b937691e3
3 changed files with 9 additions and 11 deletions

View File

@ -38,7 +38,7 @@ android {
} }
dependencies { dependencies {
compile 'com.simplemobiletools:commons:2.41.19' compile 'com.simplemobiletools:commons:2.42.6'
} }
Properties props = new Properties() Properties props = new Properties()

View File

@ -1,12 +1,10 @@
package com.simplemobiletools.thankyou.activities package com.simplemobiletools.thankyou.activities
import android.content.Intent import android.content.Intent
import android.os.Bundle import com.simplemobiletools.commons.activities.BaseSplashActivity
import android.support.v7.app.AppCompatActivity
class SplashActivity : AppCompatActivity() { class SplashActivity : BaseSplashActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun initActivity() {
super.onCreate(savedInstanceState)
startActivity(Intent(this, MainActivity::class.java)) startActivity(Intent(this, MainActivity::class.java))
finish() finish()
} }

View File

@ -46,12 +46,16 @@ class MyContentProviderDbHelper private constructor(private val context: Context
} }
fun updateTheme(values: ContentValues): Int { fun updateTheme(values: ContentValues): Int {
if (!isThemeAvailable()) {
insertDefaultTheme()
}
val selection = "$COL_ID = ?" val selection = "$COL_ID = ?"
val selectionArgs = arrayOf(THEME_ID.toString()) val selectionArgs = arrayOf(THEME_ID.toString())
return mDb.update(TABLE_NAME, values, selection, selectionArgs) return mDb.update(TABLE_NAME, values, selection, selectionArgs)
} }
fun isThemeAvailable(): Boolean { private fun isThemeAvailable(): Boolean {
val cols = arrayOf(COL_ID) val cols = arrayOf(COL_ID)
val selection = "$COL_ID = ?" val selection = "$COL_ID = ?"
val selectionArgs = arrayOf(THEME_ID.toString()) val selectionArgs = arrayOf(THEME_ID.toString())
@ -65,10 +69,6 @@ class MyContentProviderDbHelper private constructor(private val context: Context
} }
fun getSharedTheme(): Cursor? { fun getSharedTheme(): Cursor? {
if (!isThemeAvailable()) {
insertDefaultTheme()
}
val cols = arrayOf(COL_TEXT_COLOR, COL_BACKGROUND_COLOR, COL_PRIMARY_COLOR, COL_LAST_UPDATED_TS) val cols = arrayOf(COL_TEXT_COLOR, COL_BACKGROUND_COLOR, COL_PRIMARY_COLOR, COL_LAST_UPDATED_TS)
val selection = "$COL_ID = ?" val selection = "$COL_ID = ?"
val selectionArgs = arrayOf(THEME_ID.toString()) val selectionArgs = arrayOf(THEME_ID.toString())