aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
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)
})
}