Эх сурвалжийг харах

streamline colors

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 жил өмнө
parent
commit
0b7e4c09f4

+ 1 - 1
app/src/main/java/com/nextcloud/talk/activities/BaseActivity.kt

@@ -108,7 +108,7 @@ open class BaseActivity : AppCompatActivity() {
             LovelyStandardDialog(this)
                     .setTopColorRes(R.color.nc_darkRed)
                     .setNegativeButtonColorRes(R.color.nc_darkRed)
-                    .setPositiveButtonColorRes(R.color.colorPrimaryDark)
+                    .setPositiveButtonColorRes(R.color.colorPrimary)
                     .setIcon(R.drawable.ic_security_white_24dp)
                     .setTitle(R.string.nc_certificate_dialog_title)
                     .setMessage(dialogText)

+ 3 - 3
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicIncomingTextMessageViewHolder.kt

@@ -247,14 +247,14 @@ class MagicIncomingTextMessageViewHolder(incomingView: View) : MessageHolders
                     ?: context!!.getText(R.string.nc_nick_guest)
             quotedMessage?.text = parentChatMessage.text
 
-            quotedUserName?.setTextColor(context!!.resources.getColor(R.color.colorPrimary))
+            quotedUserName?.setTextColor(context!!.resources.getColor(R.color.textColorMaxContrast))
 
             quotedMessageTime?.text = DateFormatter.format(parentChatMessage.createdAt, DateFormatter.Template.TIME)
             quotedMessageTime?.setTextColor(context!!.resources.getColor(R.color.warm_grey_four))
-            quoteColoredView?.setBackgroundResource(R.color.colorPrimary)
+            quoteColoredView?.setBackgroundResource(R.color.textColorMaxContrast)
             quotedChatMessageView?.visibility = View.VISIBLE
         } ?: run {
             quotedChatMessageView?.visibility = View.GONE
         }
     }
-}
+}

+ 5 - 5
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicOutcomingTextMessageViewHolder.kt

@@ -133,16 +133,16 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
         val resources = sharedApplication!!.resources
         if (message.isGrouped) {
             val bubbleDrawable = getMessageSelector(
-                    resources.getColor(R.color.bg_message_list_outcoming_bubble),
+                    resources.getColor(R.color.colorPrimary),
                     resources.getColor(R.color.transparent),
-                    resources.getColor(R.color.bg_message_list_outcoming_bubble),
+                    resources.getColor(R.color.colorPrimary),
                     R.drawable.shape_grouped_outcoming_message)
             ViewCompat.setBackground(bubble, bubbleDrawable)
         } else {
             val bubbleDrawable = getMessageSelector(
-                    resources.getColor(R.color.bg_message_list_outcoming_bubble),
+                    resources.getColor(R.color.colorPrimary),
                     resources.getColor(R.color.transparent),
-                    resources.getColor(R.color.bg_message_list_outcoming_bubble),
+                    resources.getColor(R.color.colorPrimary),
                     R.drawable.shape_outcoming_message)
             ViewCompat.setBackground(bubble, bubbleDrawable)
         }
@@ -187,4 +187,4 @@ class MagicOutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessage
         ButterKnife.bind(this, itemView)
         this.realView = itemView
     }
-}
+}

+ 5 - 2
app/src/main/java/com/nextcloud/talk/adapters/messages/MagicSystemMessageViewHolder.java

@@ -26,7 +26,7 @@ import android.graphics.drawable.Drawable;
 import android.text.Spannable;
 import android.text.SpannableString;
 import android.view.View;
-import androidx.core.view.ViewCompat;
+
 import com.nextcloud.talk.R;
 import com.nextcloud.talk.application.NextcloudTalkApplication;
 import com.nextcloud.talk.models.json.chat.ChatMessage;
@@ -35,7 +35,10 @@ import com.nextcloud.talk.utils.preferences.AppPreferences;
 import com.stfalcon.chatkit.messages.MessageHolders;
 
 import java.util.Map;
+
 import javax.inject.Inject;
+
+import androidx.core.view.ViewCompat;
 import autodagger.AutoInjector;
 
 @AutoInjector(NextcloudTalkApplication.class)
@@ -63,7 +66,7 @@ public class MagicSystemMessageViewHolder extends MessageHolders.IncomingTextMes
 
 
         pressedColor = normalColor;
-        mentionColor = resources.getColor(R.color.nc_author_text);
+        mentionColor = resources.getColor(R.color.textColorMaxContrast);
 
         Drawable bubbleDrawable = DisplayUtils.getMessageSelector(normalColor,
                                 resources.getColor(R.color.transparent), pressedColor,

+ 1 - 1
app/src/main/res/drawable/accent_circle.xml

@@ -22,5 +22,5 @@
 <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="oval">
     <solid
-        android:color="@color/colorAccent"/>
+        android:color="@color/colorPrimary"/>
 </shape>

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

@@ -108,8 +108,8 @@
         app:outcomingBubblePaddingLeft="@dimen/message_bubble_corners_padding"
         app:outcomingBubblePaddingRight="@dimen/message_bubble_corners_padding"
         app:outcomingBubblePaddingTop="@dimen/message_bubble_corners_padding"
-        app:outcomingDefaultBubbleColor="@color/bg_message_list_outcoming_bubble"
-        app:outcomingDefaultBubblePressedColor="@color/bg_message_list_outcoming_bubble"
+        app:outcomingDefaultBubbleColor="@color/colorPrimary"
+        app:outcomingDefaultBubblePressedColor="@color/colorPrimary"
         app:outcomingDefaultBubbleSelectedColor="@color/transparent"
         app:outcomingImageTimeTextSize="12sp"
         app:outcomingTextColor="@color/nc_outcoming_text_default"

+ 1 - 0
app/src/main/res/layout/controller_conversations_rv.xml

@@ -91,6 +91,7 @@
         android:layout_gravity="bottom|end"
         android:backgroundTint="@color/colorPrimary"
         android:layout_margin="16dp"
+        app:borderWidth="0dp"
         app:tint="@color/white"
         app:srcCompat="@drawable/ic_add_white_24px"/>
 

+ 4 - 2
app/src/main/res/layout/controller_server_selection.xml

@@ -65,7 +65,8 @@
         android:text="@string/nc_get_from_provider"
         android:textAlignment="center"
         android:textAllCaps="true"
-        android:textColor="@color/nc_light_blue_color" />
+        android:alpha="0.5"
+        android:textColor="@color/textColorOnPrimaryBackground" />
 
     <TextView
         android:id="@+id/cert_text_view"
@@ -80,7 +81,8 @@
         android:text="@string/nc_configure_cert_auth"
         android:textAlignment="center"
         android:textAllCaps="true"
-        android:textColor="@color/nc_light_blue_color" />
+        android:alpha="0.5"
+        android:textColor="@color/textColorOnPrimaryBackground" />
 
     <studio.carbonylgroup.textfieldboxes.TextFieldBoxes
         android:id="@+id/text_field_boxes"

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

@@ -54,7 +54,7 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginBottom="4dp"
-            android:textColor="@color/colorPrimary"
+            android:textColor="@color/textColorMaxContrast"
             android:textSize="12sp" />
 
         <androidx.emoji.widget.EmojiTextView

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

@@ -47,7 +47,7 @@
             android:gravity="center_horizontal"
             android:textAlignment="center"
             tools:text="System message"
-            android:textColor="@color/colorPrimary"
+            android:textColor="@color/textColorMaxContrast"
             android:textSize="14sp"
             app:layout_alignSelf="flex_start"
             app:layout_flexGrow="1"

+ 2 - 2
app/src/main/res/layout/rv_item_conversation_with_last_message.xml

@@ -83,7 +83,7 @@
                 android:gravity="top"
                 android:lines="1"
                 android:singleLine="true"
-                android:textColor="@color/conversation_last_message"
+                android:textColor="@color/textColorMaxContrast"
                 tools:text="This is the last message\nof an incredibly long two line  conversation text" />
 
             <TextView
@@ -110,7 +110,7 @@
             android:layout_alignParentEnd="true"
             android:ellipsize="end"
             android:maxLines="1"
-            android:textColor="@color/conversation_date" />
+            android:textColor="@color/textColorMaxContrast" />
 
         <androidx.emoji.widget.EmojiTextView
             android:id="@id/dialogName"

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

@@ -58,7 +58,7 @@
             android:layout_height="wrap_content"
             android:ellipsize="middle"
             android:singleLine="true"
-            android:textColor="@color/nc_author_text"
+            android:textColor="@color/textColorMaxContrast"
             android:textSize="16sp"
             tools:text="Call item text" />
 

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

@@ -22,23 +22,19 @@
   -->
 
 <resources>
-    <color name="conversation_item_header">#9FBDCC</color>
-    <!--<color name="conversation_item_header">#CFCFCF</color>-->
+    <color name="conversation_item_header">#ffffff</color>
 
     <color name="bg_default">#222222</color>
     <color name="bg_alt">#222222</color>
 
     <!-- Chat window incoming message text & informational -->
     <color name="nc_incoming_text_default">#D8D8D8</color>
-    <color name="nc_author_text">#65A7CA</color>
-    <color name="nc_chip_mention_you_background">#0083C9</color>
-    <color name="nc_chip_mention_others_background">#6F6F6F</color>
     <color name="nc_grey">@android:color/holo_purple</color>
     <color name="bg_bottom_sheet">#222222</color>
     <color name="bg_message_list_incoming_bubble">#484848</color>
-    <color name="bg_message_list_outcoming_bubble">#003F62</color>
 
+    <color name="textColorMaxContrast">#8c8c8c</color>
 
     <color name="emoji_background">#313031</color>
     <color name="emoji_divider">#15FFFFFF</color>
-</resources>
+</resources>

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

@@ -21,8 +21,7 @@
 
 <resources>
     <color name="colorPrimary">#0082C9</color>
-    <color name="colorPrimaryDark">#006AA3</color>
-    <color name="colorAccent">#007CC2</color>
+    <color name="textColorOnPrimaryBackground">#ffffff</color> <!-- white/black depending on primary color -->
 
     <!-- Text color of sent messages -->
     <color name="nc_outcoming_text_default">#FFFFFF</color>
@@ -30,9 +29,7 @@
     <color name="nc_incoming_text_default">#37505D</color>
 
     <!-- Name of person or group for the chat conversation -->
-    <color name="conversation_item_header">#37505D</color>
-    <color name="conversation_date">@color/warm_grey_two</color>
-    <color name="conversation_last_message">@color/warm_grey_four</color>
+    <color name="conversation_item_header">#000000</color>
     <color name="conversation_unread_bubble">#FFFFFF</color>
 
     <color name="nc_incoming_text_mention_you">#C98879</color>
@@ -41,12 +38,12 @@
     <color name="nc_darkRed">#D32F2F</color>
     <color name="nc_darkGreen">#006400</color>
     <color name="nc_white_color">@color/per70white</color>
-    <color name="nc_light_blue_color">#7FC0E3</color>
     <color name="controller_chat_separator">#E8E8E8</color>
     <color name="grey_600">#757575</color>
     <color name="nc_grey">#D5D5D5</color>
     <color name="controller_call_incomingCallTextView">#E9FFFFFF</color>
     <color name="grey950">#111111</color>
+    <color name="textColorMaxContrast">#767676</color>
     <color name="whiteHalfTransparent">#7Fffffff</color>
 
     <!-- Emoji list in chat window -->
@@ -59,14 +56,9 @@
 
     <color name="bg_default">#FFFFFF</color>
     <color name="bg_alt">@color/white60</color>
-    <color name="nc_chip_mention_you_background">#0083C9</color>
-    <color name="nc_chip_mention_others_background">@color/white</color>
     <color name="bg_dark_mention_chips">#333333</color>
 
-
     <color name="bg_message_list_incoming_bubble">#EFEFEF</color>
-    <color name="bg_message_list_outcoming_bubble">@color/colorPrimary</color>
 
-    <color name="nc_author_text">#65A7CA</color>
     <color name="bg_bottom_sheet">#46ffffff</color>
 </resources>

+ 3 - 3
app/src/main/res/values/styles.xml

@@ -24,7 +24,7 @@
     <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
         <!-- Customize your theme here. -->
         <item name="colorPrimary">@color/colorPrimary</item>
-        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorPrimaryDark">@color/colorPrimary</item>
         <item name="colorAccent">@color/colorPrimary</item>
         <item name="android:panelFullBackground">@color/colorPrimary</item>
         <item name="android:itemBackground">@color/nc_outcoming_text_default</item>
@@ -48,11 +48,11 @@
     </style>
 
     <style name="ChipOutgoingTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
-        <item name="android:textColor">@color/nc_incoming_text_default</item>
+        <item name="android:textColor">@color/textColorOnPrimaryBackground</item>
     </style>
 
     <style name="ChipMentionTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
-        <item name="android:textColor">@color/colorAccent</item>
+        <item name="android:textColor">@color/colorPrimary</item>
     </style>
 
     <style name="appActionBarStyle" parent="@style/Widget.MaterialComponents.ActionBar.Solid">

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

@@ -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/ChipIncomingTextAppearance"
-    app:chipBackgroundColor="@color/nc_chip_mention_others_background"
+    app:chipBackgroundColor="@color/white"
     app:closeIconEnabled="false" />

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

@@ -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/ChipOutgoingTextAppearance"
-    app:chipBackgroundColor="@color/nc_chip_mention_you_background"
+    app:chipBackgroundColor="@color/colorPrimary"
     app:closeIconEnabled="false"/>