diff options
author | Allan Wang <me@allanwang.ca> | 2017-08-19 00:50:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 00:50:59 -0700 |
commit | 1538c192b57153e50db524f2f8b0ad3656209344 (patch) | |
tree | 0fb0f83af4862a127bca7d8451ef2c7188a08d83 /app/src/main/kotlin | |
parent | f5394badad02671dc0de181ab63b9a9bfbe9fd59 (diff) | |
download | frost-1538c192b57153e50db524f2f8b0ad3656209344.tar.gz frost-1538c192b57153e50db524f2f8b0ad3656209344.tar.bz2 frost-1538c192b57153e50db524f2f8b0ad3656209344.zip |
Enhancement/media-camera-picker (#194)
* Update kau
* Update changelog
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt | 6 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt index d42b5d9f..162baf20 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt @@ -1,12 +1,10 @@ package com.pitchedapps.frost.activities import android.content.Context -import android.graphics.Color import android.net.Uri import android.support.v4.content.FileProvider import ca.allanwang.kau.mediapicker.* import ca.allanwang.kau.utils.colorToBackground -import ca.allanwang.kau.utils.isColorVisibleOn import com.pitchedapps.frost.BuildConfig import com.pitchedapps.frost.utils.Prefs import java.io.File @@ -15,9 +13,7 @@ import java.io.File * Created by Allan Wang on 2017-07-23. */ private fun actions(): List<MediaAction> { - var color = Prefs.iconBackgroundColor - if (!color.isColorVisibleOn(Color.WHITE, 50)) - color = 0xff3b5998.toInt() + val color = Prefs.accentColorForWhite return listOf(object : MediaActionCamera(color) { override fun createFile(context: Context): File 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 27405026..34257da8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -1,10 +1,10 @@ package com.pitchedapps.frost.utils +import android.graphics.Color import ca.allanwang.kau.kotlin.lazyResettable import ca.allanwang.kau.kpref.KPref import ca.allanwang.kau.kpref.StringSet import ca.allanwang.kau.kpref.kpref -import ca.allanwang.kau.utils.colorToForeground import ca.allanwang.kau.utils.isColorVisibleOn import com.pitchedapps.frost.facebook.FeedSort import com.pitchedapps.frost.injectors.InjectorContract @@ -54,6 +54,11 @@ object Prefs : KPref() { val accentColor: Int get() = t.accentColor + val accentColorForWhite: Int + get() = if (accentColor.isColorVisibleOn(Color.WHITE)) accentColor + else if (textColor.isColorVisibleOn(Color.WHITE)) textColor + else FACEBOOK_BLUE + val bgColor: Int get() = t.bgColor |