mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
fix text color for system default dark mode
This commit is contained in:
parent
3c293f9d2b
commit
2b26876c4c
@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.conversation.v2.messages
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.util.Linkify
|
||||
import android.util.AttributeSet
|
||||
@ -141,11 +142,11 @@ class VisibleMessageContentView : LinearLayout {
|
||||
|
||||
@ColorInt
|
||||
fun getTextColor(context: Context, message: MessageRecord): Int {
|
||||
val uiMode = UiModeUtilities.getUserSelectedUiMode(context)
|
||||
val isDayUiMode = UiModeUtilities.isDayUiMode(context)
|
||||
val colorID = if (message.isOutgoing) {
|
||||
if (uiMode == UiMode.NIGHT) R.color.black else R.color.white
|
||||
if (isDayUiMode) R.color.white else R.color.black
|
||||
} else {
|
||||
if (uiMode == UiMode.NIGHT) R.color.white else R.color.black
|
||||
if (isDayUiMode) R.color.black else R.color.white
|
||||
}
|
||||
return context.resources.getColorWithID(colorID, context.theme)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user