aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-09-24 16:28:15 -0400
committerGitHub <noreply@github.com>2017-09-24 16:28:15 -0400
commit251e697e8e3a17370359273c5fcf7cc2a9f33912 (patch)
tree96ca0b2c13066004cbbec464f2d366b1b738de20 /app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
parentc4453c85557d2dbf24fa72def544335fe5782182 (diff)
downloadfrost-251e697e8e3a17370359273c5fcf7cc2a9f33912.tar.gz
frost-251e697e8e3a17370359273c5fcf7cc2a9f33912.tar.bz2
frost-251e697e8e3a17370359273c5fcf7cc2a9f33912.zip
Enhancement/rating (#334)
* Add rating button after one month * Add rating for pro purchase and clean dialogs * Update kau
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt10
1 files changed, 10 insertions, 0 deletions
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 e5e1a706..aeddd20c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -16,6 +16,7 @@ import android.widget.TextView
import ca.allanwang.kau.mediapicker.createMediaFile
import ca.allanwang.kau.mediapicker.createPrivateMediaFile
import ca.allanwang.kau.utils.*
+import ca.allanwang.kau.xml.showChangelog
import com.afollestad.materialdialogs.MaterialDialog
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.load.resource.bitmap.CircleCrop
@@ -197,3 +198,12 @@ fun Context.resolveActivityForUri(uri: Uri): Boolean {
inline val String?.isFacebookUrl
get() = this != null && this.contains(FACEBOOK_COM)
+fun Context.frostChangelog() = showChangelog(R.xml.frost_changelog, Prefs.textColor) {
+ theme()
+ if (System.currentTimeMillis() - Prefs.installDate > 2592000000) { //show after 1 month
+ neutralText(R.string.kau_rate)
+ onNeutral { _, _ -> startPlayStoreLink(R.string.play_store_package_id) }
+ }
+}
+
+