소스 검색

Tweaks to message colours.

Signed-off-by: Daniel Bailey <daniel.bailey@grappleIT.co.uk>
Daniel Bailey 5 년 전
부모
커밋
a4efa5a746

+ 10 - 2
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.java

@@ -45,6 +45,7 @@ import com.nextcloud.talk.models.json.chat.ChatMessage;
 import com.nextcloud.talk.utils.DisplayUtils;
 import com.nextcloud.talk.utils.TextMatchers;
 import com.nextcloud.talk.utils.database.user.UserUtils;
+import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.stfalcon.chatkit.messages.MessageHolders;
 
 import javax.inject.Inject;
@@ -73,6 +74,9 @@ public class MagicIncomingTextMessageViewHolder
     @Inject
     Context context;
 
+    @Inject
+    AppPreferences appPreferences;
+
     private View itemView;
 
     public MagicIncomingTextMessageViewHolder(View itemView) {
@@ -120,10 +124,14 @@ public class MagicIncomingTextMessageViewHolder
         } else {
             Resources resources = context.getResources();
 
+            int bg_bubble_color = appPreferences.isDarkThemeEnabled() ?
+                                resources.getColor(R.color.bg_message_list_incoming_bubble_dark2) :
+                                resources.getColor(R.color.bg_message_list_incoming_bubble);
+
             messageUserAvatarView.setVisibility(View.INVISIBLE);
-            Drawable bubbleDrawable = DisplayUtils.getMessageSelector(resources.getColor(R.color.white_two),
+            Drawable bubbleDrawable = DisplayUtils.getMessageSelector(bg_bubble_color,
                     resources.getColor(R.color.transparent),
-                    resources.getColor(R.color.white_two), R.drawable.shape_grouped_incoming_message);
+                    bg_bubble_color, R.drawable.shape_grouped_incoming_message);
             ViewCompat.setBackground(bubble, bubbleDrawable);
             messageAuthor.setVisibility(View.GONE);
         }

+ 4 - 1
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicSystemMessageViewHolder.java

@@ -54,7 +54,10 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
         super.onBind(message);
 
         Resources resources = NextcloudTalkApplication.getSharedApplication().getResources();
-        int normalColor, pressedColor, mentionYouColor, mentionOthersColor;
+        int normalColor;
+        int pressedColor;
+        int mentionYouColor;
+        int mentionOthersColor;
 
         if(appPreferences.isDarkThemeEnabled()) {
             normalColor = resources.getColor(R.color.bg_system_bubble_dark);

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

@@ -22,7 +22,8 @@
   -->
 
 <resources>
-    <color name="conversation_item_header">#6c94a8</color>
+    <color name="conversation_item_header">#9FBDCC</color>
+    <!--<color name="conversation_item_header">#CFCFCF</color>-->
 
     <color name="fg_default">#eeeeee</color>
 
@@ -30,15 +31,16 @@
     <color name="bg_alt">#333333</color>
 
     <!-- Chat window incoming message text & informational -->
-    <color name="nc_incoming_text_default">#8FADBD</color>
+    <color name="nc_incoming_text_default">#9FBDCC</color>
+    <!--<color name="nc_incoming_text_default">#CFCFCF</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>
+    <color name="bg_message_list_incoming_bubble">#444444</color>
 
     <color name="emoji_background">#313031</color>
     <color name="emoji_divider">#15FFFFFF</color>

+ 2 - 1
app/src/main/res/values/colors.xml

@@ -64,9 +64,10 @@
     <color name="bg_default">#FFFFFF</color>
     <color name="bg_alt">@color/white60</color>
     <color name="bg_system_bubble_dark">#444444</color>
+    <color name="bg_message_list_incoming_bubble">#EFEFEF</color>
+    <color name="bg_message_list_incoming_bubble_dark2">#444444</color>
     <color name="bg_bottom_sheet">#46ffffff</color>
 
     <!-- "Conversation Info" window -->
     <color name="bg_controller_conv_info">@color/bg_default</color>
-    <color name="bg_message_list_incoming_bubble">#979797</color>
 </resources>