aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-29 17:10:56 -0700
committerAllan Wang <me@allanwang.ca>2017-06-29 17:10:56 -0700
commit601b0492110f17e5f9a1a446897e0b42d4a8cffe (patch)
tree6a0ffff352a14449aaf36dcecab7171860a73ce9 /app/src/main/kotlin
parent7b6371ada06ca337c0a5e97382be8eca9f2c9650 (diff)
downloadfrost-601b0492110f17e5f9a1a446897e0b42d4a8cffe.tar.gz
frost-601b0492110f17e5f9a1a446897e0b42d4a8cffe.tar.bz2
frost-601b0492110f17e5f9a1a446897e0b42d4a8cffe.zip
Adding about app
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/AboutActivity.kt44
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt4
3 files changed, 30 insertions, 24 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/AboutActivity.kt
index fe753872..b5485e38 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/AboutActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/AboutActivity.kt
@@ -1,17 +1,27 @@
-//package com.pitchedapps.frost
-//
-//import android.os.Bundle
-//import android.support.v7.app.AppCompatActivity
-//import com.mikepenz.aboutlibraries.Libs
-//
-//
-//
-///**
-// * Created by Allan Wang on 2017-06-26.
-// */
-//class AboutActivity : AppCompatActivity() {
-// override fun onCreate(savedInstanceState: Bundle?) {
-// super.onCreate(savedInstanceState)
-// val libs = Libs.getInstance(this, R.string::class.java.fields)
-// }
-//} \ No newline at end of file
+package com.pitchedapps.frost
+
+import ca.allanwang.kau.about.AboutActivityBase
+import ca.allanwang.kau.adapters.FastItemThemedAdapter
+import ca.allanwang.kau.iitems.CardIItem
+import ca.allanwang.kau.utils.isColorVisibleOn
+import ca.allanwang.kau.utils.withMinAlpha
+import com.mikepenz.fastadapter.IItem
+import com.pitchedapps.frost.utils.Prefs
+
+
+/**
+ * Created by Allan Wang on 2017-06-26.
+ */
+class AboutActivity : AboutActivityBase(R.string::class.java, configBuilder = {
+ textColor = Prefs.textColor
+ accentColor = Prefs.accentColor
+ backgroundColor = Prefs.bgColor.withMinAlpha(200)
+ cutoutForeground = if (0xff3b5998.toInt().isColorVisibleOn(Prefs.bgColor)) 0xff3b5998.toInt() else Prefs.accentColor
+ cutoutDrawableRes = R.drawable.frost_f_256
+}) {
+ override fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) {
+ adapter.add(CardIItem {
+ descRes = R.string.frost_description
+ })
+ }
+} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
index 3900849b..1d3ce5be 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
@@ -53,11 +53,7 @@ class SettingsActivity : KPrefActivity() {
plainText(R.string.about_frost) {
onClick = {
_, _, _ ->
- LibsBuilder()
- //provide a style (optional) (LIGHT, DARK, LIGHT_DARK_TOOLBAR)
- .withActivityStyle(Libs.ActivityStyle.LIGHT_DARK_TOOLBAR)
- //start the activity
- .start(this@SettingsActivity)
+ startActivity(AboutActivity::class.java, transition = true)
true
}
}
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 3fe33475..986f9565 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -32,7 +32,7 @@ internal const val EXTRA_COOKIES = "extra_cookies"
internal const val ARG_URL = "arg_url"
fun Context.launchNewTask(clazz: Class<out Activity>, cookieList: ArrayList<CookieModel> = arrayListOf(), clearStack: Boolean = false) {
- startActivity(clazz, clearStack, {
+ startActivity(clazz, clearStack, intentBuilder = {
putParcelableArrayListExtra(EXTRA_COOKIES, cookieList)
})
}
@@ -60,7 +60,7 @@ val String.formattedFbUrl: String
fun Context.launchWebOverlay(url: String) {
val argUrl = url.formattedFbUrl
L.i("Launch web overlay: $argUrl")
- startActivity(WebOverlayActivity::class.java, false, {
+ startActivity(WebOverlayActivity::class.java, false, intentBuilder = {
putExtra(ARG_URL, argUrl)
})
}