Merge pull request #618 from RyanRory/ui

Fix Theme Issues
This commit is contained in:
Niels Andriesse 2021-06-28 11:30:32 +10:00 committed by GitHub
commit ab92f3684d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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)
}

View File

@ -18,7 +18,7 @@
<item name="android:colorBackground">@color/default_background_start</item>
<item name="android:navigationBarColor">@color/compose_view_background</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.DayNight</item>
<item name="actionBarWidgetTheme">@null</item>
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.DayNight.ActionBar</item>
<item name="actionBarStyle">@style/Widget.Session.ActionBar</item>