Altered colours used by system message bubble and @ avatars.

Signed-off-by: Daniel Bailey <daniel.bailey@grappleIT.co.uk>
This commit is contained in:
Daniel Bailey 2019-06-26 20:53:43 +01:00 committed by Mario Đanić
parent 8a013cb837
commit f384651c81
5 changed files with 28 additions and 10 deletions

View File

@ -54,19 +54,26 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
super.onBind(message);
Resources resources = NextcloudTalkApplication.getSharedApplication().getResources();
int normalColor, pressedColor, mentionYouColor, mentionOthersColor;
int normalColor = appPreferences.isDarkThemeEnabled() ? resources.getColor(R.color.bg_system_bubble_dark) :
resources.getColor(R.color.white_two);
int pressedColor = normalColor;
if(appPreferences.isDarkThemeEnabled()) {
normalColor = resources.getColor(R.color.bg_system_bubble_dark);
mentionYouColor = resources.getColor(R.color.fg_mention_you_dark);
mentionOthersColor = resources.getColor(R.color.fg_mention_others_dark);
} else {
normalColor = resources.getColor(R.color.white_two);
mentionYouColor = resources.getColor(R.color.fg_mention_you);
mentionOthersColor = resources.getColor(R.color.fg_mention_others);
}
pressedColor = normalColor;
Drawable bubbleDrawable = DisplayUtils.getMessageSelector(normalColor,
resources.getColor(R.color.transparent), pressedColor,
R.drawable.shape_grouped_incoming_message);
resources.getColor(R.color.transparent), pressedColor,
R.drawable.shape_grouped_incoming_message);
ViewCompat.setBackground(bubble, bubbleDrawable);
Spannable messageString = new SpannableString(message.getText());
Context context = NextcloudTalkApplication.getSharedApplication().getApplicationContext();
if (message.getMessageParameters() != null && message.getMessageParameters().size() > 0) {
for (String key : message.getMessageParameters().keySet()) {
Map<String, String> individualHashMap = message.getMessageParameters().get(key);
@ -74,9 +81,9 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
if (individualHashMap != null && (individualHashMap.get("type").equals("user") || individualHashMap.get("type").equals("guest") || individualHashMap.get("type").equals("call"))) {
if (individualHashMap.get("id").equals(message.getActiveUser().getUserId())) {
color = context.getResources().getColor(R.color.nc_incoming_text_mention_you);
color = mentionYouColor;
} else {
color = context.getResources().getColor(R.color.nc_incoming_text_mention_others);
color = mentionOthersColor;
}
messageString =

View File

@ -81,7 +81,7 @@
app:pb_backgroundColor="@color/colorPrimary"
app:pb_icon="@drawable/ic_baseline_arrow_downward_24px"
app:pb_text="@string/nc_new_messages"
app:pb_textColor="@color/bg_default" />
app:pb_textColor="@color/fg_inverse" />
<View
android:id="@+id/separator"

View File

@ -31,6 +31,11 @@
<!-- Chat window incoming message text & informational -->
<color name="nc_incoming_text_default">#8FADBD</color>
<color name="nc_incoming_text_mention_you">#C98879</color>
<!--<color name="nc_incoming_text_mention_others">#3a718f</color>-->
<color name="nc_incoming_text_mention_others">@color/nc_darkRed</color>
<color name="bg_message_list_incoming_bubble">#444444</color>
<color name="nc_grey">@android:color/holo_purple</color>
<color name="bg_bottom_sheet">#222222</color>

View File

@ -55,6 +55,12 @@
<color name="fg_default">#000000</color>
<color name="fg_inverse">#FFFFFF</color>
<color name="fg_mention_you">#C98879</color>
<color name="fg_mention_others">#37505D</color>
<color name="fg_mention_you_dark">#C98879</color>
<color name="fg_mention_others_dark">#4c96bd</color>
<color name="bg_default">#FFFFFF</color>
<color name="bg_alt">@color/white60</color>
<color name="bg_system_bubble_dark">#444444</color>

View File

@ -22,5 +22,5 @@
<chip xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:textAppearance="@style/ChipMentionTextAppearance"
app:chipBackgroundColor="@color/white"
app:chipBackgroundColor="@color/bg_default"
app:closeIconEnabled="false" />