diff --git a/app/src/main/java/org/futo/circles/extensions/ContextExtensions.kt b/app/src/main/java/org/futo/circles/extensions/ContextExtensions.kt index cf6045dcd2946f279282fd6e2dd4a98a847ab249..7f1f2964139e33c58ab01357285ea1210146163d 100644 --- a/app/src/main/java/org/futo/circles/extensions/ContextExtensions.kt +++ b/app/src/main/java/org/futo/circles/extensions/ContextExtensions.kt @@ -2,6 +2,7 @@ package org.futo.circles.extensions import android.content.Context import android.content.pm.PackageManager +import android.content.res.Configuration import android.graphics.Bitmap import android.graphics.Canvas import android.util.DisplayMetrics @@ -45,4 +46,13 @@ fun Context.getApplicationLabel(packageName: String): String { } catch (e: PackageManager.NameNotFoundException) { packageName } +} + +fun Context.isNightMode(): Boolean { + return when (resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK) { + Configuration.UI_MODE_NIGHT_YES -> true + Configuration.UI_MODE_NIGHT_NO -> false + Configuration.UI_MODE_NIGHT_UNDEFINED -> false + else -> false + } } \ No newline at end of file diff --git a/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt b/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt index d11becdc83f2c8e5c2ede6085d53b3eb9ceb4ad0..bcda7fd006d7a91e8e4b8fc351fbe9cdd1b5464e 100644 --- a/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt +++ b/app/src/main/java/org/futo/circles/feature/timeline/post/emoji/EmojiBottomSheet.kt @@ -1,7 +1,6 @@ package org.futo.circles.feature.timeline.post.emoji import android.content.Context -import android.graphics.Color import android.os.Bundle import android.view.LayoutInflater import android.view.View @@ -13,6 +12,7 @@ import com.vanniktech.emoji.EmojiTheming import org.futo.circles.R import org.futo.circles.core.base.fragment.TransparentBackgroundBottomSheetDialogFragment import org.futo.circles.databinding.BottomSheetEmojiBinding +import org.futo.circles.extensions.isNightMode interface EmojiPickerListener { fun onEmojiSelected(roomId: String?, eventId: String?, emoji: String) @@ -57,17 +57,20 @@ class EmojiBottomSheet : TransparentBackgroundBottomSheetDialogFragment() { org.futo.circles.core.R.color.post_card_background_color ), primaryColor = ContextCompat.getColor( + requireContext(), + R.color.gray + ), + secondaryColor = ContextCompat.getColor( requireContext(), R.color.blue ), - secondaryColor = Color.RED, dividerColor = ContextCompat.getColor( requireContext(), org.futo.circles.core.R.color.divider_color ), textColor = ContextCompat.getColor( requireContext(), - R.color.black + if (context.isNightMode()) R.color.white else R.color.black ), textSecondaryColor = ContextCompat.getColor( requireContext(),