aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/MediaPickerActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt7
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