diff options
author | Allan Wang <me@allanwang.ca> | 2019-07-01 21:36:55 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-07-01 21:36:55 -0700 |
commit | ce1c8ef5798e32987c90c9ffa05230472e27e78e (patch) | |
tree | cf4b9f70a71459520bff2cdfeb981bb9b0e9e398 | |
parent | 1472aa3bba0b5865aee1c52168bbc49a9f37c40b (diff) | |
download | frost-ce1c8ef5798e32987c90c9ffa05230472e27e78e.tar.gz frost-ce1c8ef5798e32987c90c9ffa05230472e27e78e.tar.bz2 frost-ce1c8ef5798e32987c90c9ffa05230472e27e78e.zip |
Update versions and add image activity test start
-rw-r--r-- | app/build.gradle | 16 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt | 26 | ||||
-rw-r--r-- | gradle.properties | 2 |
3 files changed, 24 insertions, 20 deletions
diff --git a/app/build.gradle b/app/build.gradle index 2348e053..a95457dd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -189,21 +189,21 @@ dependencies { implementation kau.Dependencies.kotlin //noinspection GradleDependency - implementation "ca.allanwang.kau:adapter:${KAU}" + implementation kau.Dependencies.kau('core', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:about:${KAU}" + implementation kau.Dependencies.kau('core-ui', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:colorpicker:${KAU}" + implementation kau.Dependencies.kau('adapter', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:mediapicker:${KAU}" + implementation kau.Dependencies.kau('about', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:kpref-activity:${KAU}" + implementation kau.Dependencies.kau('colorpicker', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:searchview:${KAU}" + implementation kau.Dependencies.kau('mediapicker', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:core:${KAU}" + implementation kau.Dependencies.kau('kpref-activity', KAU) //noinspection GradleDependency - implementation "ca.allanwang.kau:core-ui:${KAU}" + implementation kau.Dependencies.kau('searchview', KAU) implementation "androidx.core:core-ktx:${Versions.ktx}" diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt index cf8acdd3..8aebb575 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt @@ -16,7 +16,6 @@ */ package com.pitchedapps.frost -import android.content.Intent import android.graphics.Color import android.os.Build import android.os.Bundle @@ -26,11 +25,9 @@ import android.widget.TextView import ca.allanwang.kau.internal.KauBaseActivity import ca.allanwang.kau.utils.buildIsLollipopAndUp import ca.allanwang.kau.utils.setIcon -import ca.allanwang.kau.utils.startActivity import ca.allanwang.kau.utils.string import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.pitchedapps.frost.activities.LoginActivity -import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.activities.SelectorActivity import com.pitchedapps.frost.db.CookieDao import com.pitchedapps.frost.db.CookieEntity @@ -43,9 +40,9 @@ import com.pitchedapps.frost.db.saveTabs import com.pitchedapps.frost.db.selectAll import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.utils.BiometricUtils -import com.pitchedapps.frost.utils.EXTRA_COOKIES import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs +import com.pitchedapps.frost.utils.launchImageActivity import com.pitchedapps.frost.utils.launchNewTask import com.pitchedapps.frost.utils.loadAssets import com.raizlabs.android.dbflow.kotlinextensions.from @@ -86,18 +83,24 @@ class StartActivity : KauBaseActivity() { FbCookie.switchBackUser() val cookies = ArrayList(cookieDao.selectAll()) L.i { "Cookies loaded at time ${System.currentTimeMillis()}" } - L._d { "Cookies: ${cookies.joinToString("\t", transform = CookieEntity::toSensitiveString)}" } + L._d { + "Cookies: ${cookies.joinToString( + "\t", + transform = CookieEntity::toSensitiveString + )}" + } loadAssets() authDefer.await() when { cookies.isEmpty() -> launchNewTask<LoginActivity>() // Has cookies but no selected account Prefs.userId == -1L -> launchNewTask<SelectorActivity>(cookies) - else -> startActivity<MainActivity>(intentBuilder = { - putParcelableArrayListExtra(EXTRA_COOKIES, cookies) - flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or - Intent.FLAG_ACTIVITY_SINGLE_TOP - }) + else -> launchImageActivity("https://images.pexels.com/photos/374870/pexels-photo-374870.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500") +// else -> startActivity<MainActivity>(intentBuilder = { +// putParcelableArrayListExtra(EXTRA_COOKIES, cookies) +// flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or +// Intent.FLAG_ACTIVITY_SINGLE_TOP +// }) } } catch (e: Exception) { L._e(e) { "Load start failed" } @@ -112,7 +115,8 @@ class StartActivity : KauBaseActivity() { */ private suspend fun migrate() = withContext(Dispatchers.IO) { if (cookieDao.selectAll().isNotEmpty()) return@withContext - val cookies = (select from CookieModel::class).queryList().map { CookieEntity(it.id, it.name, it.cookie) } + val cookies = (select from CookieModel::class).queryList() + .map { CookieEntity(it.id, it.name, it.cookie) } if (cookies.isNotEmpty()) { cookieDao.save(cookies) L._d { "Migrated cookies ${cookieDao.selectAll()}" } diff --git a/gradle.properties b/gradle.properties index 83b2027b..ea3a684a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ org.gradle.daemon = true APP_ID=Frost APP_GROUP=com.pitchedapps -KAU=5.0.0 +KAU=d91d734 android.useAndroidX=true android.enableJetifier=true |