aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-21 16:03:00 -0700
committerAllan Wang <me@allanwang.ca>2017-06-21 16:03:00 -0700
commit8769be855196f17bb7bfdfb411994ea901eb51a9 (patch)
treeae2ba73fcb63ab02dc7e83bff2f0c7f86c02c320 /app/src/main/kotlin/com/pitchedapps/frost/utils
parent1ec75d0b2b7f746e2a0ae982b936fa4f566ec738 (diff)
downloadfrost-8769be855196f17bb7bfdfb411994ea901eb51a9.tar.gz
frost-8769be855196f17bb7bfdfb411994ea901eb51a9.tar.bz2
frost-8769be855196f17bb7bfdfb411994ea901eb51a9.zip
Lots of theming and fixes
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt14
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt11
3 files changed, 15 insertions, 14 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index 9f37ff2e..83564be9 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -13,7 +13,7 @@ import com.pitchedapps.frost.injectors.InjectorContract
*/
object Prefs : KPref() {
- var lastActive: Long by kpref("last_active", -1L)
+ var lastLaunch: Long by kpref("last_launch", -1L)
var userId: Long by kpref("user_id", -1L)
@@ -37,7 +37,7 @@ object Prefs : KPref() {
var installDate: Long by kpref("install_date", -1L)
- var identifier: Int by kpref("indentifier", -1)
+ var identifier: Int by kpref("identifier", -1)
private val loader = lazyResettable { Theme.values[Prefs.theme] }
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
index 1eff6780..43bb6ec6 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Theme.kt
@@ -12,13 +12,13 @@ import com.pitchedapps.frost.injectors.JsActions
enum class Theme(val textRes: Int, val injector: InjectorContract,
private val textColorGetter: () -> Int, private val backgroundColorGetter: () -> Int,
private val headerColorGetter: () -> Int, private val iconColorGetter: () -> Int) {
- DEFAULT(R.string._default, JsActions.EMPTY, { Color.BLACK }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
- LIGHT(R.string.light, CssAssets.MATERIAL_LIGHT, { Color.BLACK }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
- DARK(R.string.dark, CssAssets.MATERIAL_DARK, { Color.WHITE }, { 0xff303030.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
- AMOLED(R.string.amoled, CssAssets.MATERIAL_AMOLED, { Color.WHITE }, { Color.BLACK }, { Color.BLACK }, { Color.WHITE }),
- GLASS(R.string.glass, CssAssets.MATERIAL_GLASS, { Color.WHITE }, { 0x80000000.toInt() }, { 0xb3000000.toInt() }, { Color.WHITE }),
- CUSTOM(R.string.custom, JsActions.EMPTY, { Prefs.customTextColor }, { Prefs.customBackgroundColor }, { Prefs.customHeaderColor }, { Prefs.customIconColor });
- //todo create custom
+ DEFAULT(R.string.kau_default, JsActions.EMPTY, { Color.BLACK }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
+ LIGHT(R.string.kau_light, CssAssets.MATERIAL_LIGHT, { Color.BLACK }, { 0xfffafafa.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
+ DARK(R.string.kau_dark, CssAssets.MATERIAL_DARK, { Color.WHITE }, { 0xff303030.toInt() }, { 0xff3b5998.toInt() }, { Color.WHITE }),
+ AMOLED(R.string.kau_amoled, CssAssets.MATERIAL_AMOLED, { Color.WHITE }, { Color.BLACK }, { Color.BLACK }, { Color.WHITE }),
+ GLASS(R.string.kau_glass, CssAssets.MATERIAL_GLASS, { Color.WHITE }, { 0x80000000.toInt() }, { 0xb3000000.toInt() }, { Color.WHITE }),
+ CUSTOM(R.string.kau_custom, JsActions.EMPTY, { Prefs.customTextColor }, { Prefs.customBackgroundColor }, { Prefs.customHeaderColor }, { Prefs.customIconColor })
+ ;
val textColor: Int
get() = textColorGetter.invoke()
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
index b9de13af..8accffde 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -5,18 +5,19 @@ import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context
-import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
+import android.support.annotation.ColorInt
import android.support.v4.app.NotificationCompat
-import android.support.v4.content.ContextCompat
import android.support.v7.widget.Toolbar
+import android.view.Menu
import android.view.View
import android.widget.TextView
import ca.allanwang.kau.utils.*
import com.afollestad.materialdialogs.MaterialDialog
import com.crashlytics.android.answers.Answers
import com.crashlytics.android.answers.CustomEvent
+import com.mikepenz.iconics.typeface.IIcon
import com.pitchedapps.frost.*
import com.pitchedapps.frost.dbflow.CookieModel
import com.pitchedapps.frost.facebook.FB_URL_BASE
@@ -58,9 +59,9 @@ val String.formattedFbUrl: String
fun Context.launchWebOverlay(url: String) {
val argUrl = url.formattedFbUrl
L.i("Launch web overlay: $argUrl")
- val intent = Intent(this, WebOverlayActivity::class.java)
- intent.putExtra(ARG_URL, argUrl)
- ContextCompat.startActivity(this, intent, null)
+ startActivity(WebOverlayActivity::class.java, false, {
+ putExtra(ARG_URL, argUrl)
+ })
}
fun WebOverlayActivity.url(): String {