浏览代码

Altered colours used by system message bubble and @ avatars.

Signed-off-by: Daniel Bailey <daniel.bailey@grappleIT.co.uk>
Daniel Bailey 5 年之前
父节点
当前提交
f384651c81

+ 15 - 8
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicSystemMessageViewHolder.java

@@ -54,19 +54,26 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
         super.onBind(message);
         super.onBind(message);
 
 
         Resources resources = NextcloudTalkApplication.getSharedApplication().getResources();
         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,
         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);
         ViewCompat.setBackground(bubble, bubbleDrawable);
 
 
         Spannable messageString = new SpannableString(message.getText());
         Spannable messageString = new SpannableString(message.getText());
 
 
-        Context context = NextcloudTalkApplication.getSharedApplication().getApplicationContext();
         if (message.getMessageParameters() != null && message.getMessageParameters().size() > 0) {
         if (message.getMessageParameters() != null && message.getMessageParameters().size() > 0) {
             for (String key : message.getMessageParameters().keySet()) {
             for (String key : message.getMessageParameters().keySet()) {
                 Map<String, String> individualHashMap = message.getMessageParameters().get(key);
                 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 != null && (individualHashMap.get("type").equals("user") || individualHashMap.get("type").equals("guest") || individualHashMap.get("type").equals("call"))) {
 
 
                     if (individualHashMap.get("id").equals(message.getActiveUser().getUserId())) {
                     if (individualHashMap.get("id").equals(message.getActiveUser().getUserId())) {
-                        color = context.getResources().getColor(R.color.nc_incoming_text_mention_you);
+                        color = mentionYouColor;
                     } else {
                     } else {
-                        color = context.getResources().getColor(R.color.nc_incoming_text_mention_others);
+                        color = mentionOthersColor;
                     }
                     }
 
 
                     messageString =
                     messageString =

+ 1 - 1
app/src/main/res/layout/controller_chat.xml

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

+ 5 - 0
app/src/main/res/values-night/colors.xml

@@ -31,6 +31,11 @@
 
 
     <!-- Chat window incoming message text & informational -->
     <!-- Chat window incoming message text & informational -->
     <color name="nc_incoming_text_default">#8FADBD</color>
     <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="bg_message_list_incoming_bubble">#444444</color>
     <color name="nc_grey">@android:color/holo_purple</color>
     <color name="nc_grey">@android:color/holo_purple</color>
     <color name="bg_bottom_sheet">#222222</color>
     <color name="bg_bottom_sheet">#222222</color>

+ 6 - 0
app/src/main/res/values/colors.xml

@@ -55,6 +55,12 @@
 
 
     <color name="fg_default">#000000</color>
     <color name="fg_default">#000000</color>
     <color name="fg_inverse">#FFFFFF</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_default">#FFFFFF</color>
     <color name="bg_alt">@color/white60</color>
     <color name="bg_alt">@color/white60</color>
     <color name="bg_system_bubble_dark">#444444</color>
     <color name="bg_system_bubble_dark">#444444</color>

+ 1 - 1
app/src/main/res/xml/chip_outgoing_own_mention.xml

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