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

Update chips colors

Signed-off-by: Mario Danic <mario@lovelyhq.com>
Mario Danic 6 жил өмнө
parent
commit
c52d08410d

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

@@ -162,7 +162,7 @@ public class MagicIncomingTextMessageViewHolder
                                             individualHashMap.get("name"),
                                             individualHashMap.get("type"),
                                             userUtils.getUserById(message.getActiveUserId()),
-                                            R.xml.chip_simple_background);
+                                            R.xml.chip_incoming_others);
                         }
 
                     } else if (individualHashMap.get("type").equals("file")) {

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

@@ -100,7 +100,7 @@ public class MagicOutcomingTextMessageViewHolder extends MessageHolders.Outcomin
                                             individualHashMap.get("name"),
                                             individualHashMap.get("type"),
                                             userUtils.getUserById(message.getActiveUserId()),
-                                            R.xml.chip_simple_background);
+                                            R.xml.chip_outgoing_others);
                         } else {
                             messageString =
                                     DisplayUtils.searchAndReplaceWithMentionSpan(messageText.getContext(),

+ 1 - 1
app/src/main/java/com/nextcloud/talk/callbacks/MentionAutocompleteCallback.java

@@ -56,7 +56,7 @@ public class MentionAutocompleteCallback implements AutocompleteCallback<Mention
         Spans.MentionChipSpan mentionChipSpan =
                 new Spans.MentionChipSpan(DisplayUtils.getDrawableForMentionChipSpan(context,
                         item.getId(), item.getLabel(), conversationUser, item.getSource(),
-                        R.xml.chip_accent_background, emojiEditText),
+                        R.xml.chip_text_entry, emojiEditText),
                         DynamicDrawableSpan.ALIGN_BASELINE,
                         item.getId(), item.getLabel());
         editable.setSpan(mentionChipSpan, start, start + item.getLabel().length(),

+ 1 - 1
app/src/main/java/com/nextcloud/talk/utils/DisplayUtils.java

@@ -237,7 +237,7 @@ public class DisplayUtils {
         boolean isCall = "call".equals(type) || "calls".equals(type);
 
         if (!isCall) {
-            if (chipResource == R.xml.chip_accent_background) {
+            if (chipResource == R.xml.chip_outgoing_others || chipResource == R.xml.chip_accent_background) {
                 drawable = R.drawable.white_circle;
             } else {
                 drawable = R.drawable.accent_circle;

+ 8 - 4
app/src/main/res/values/styles.xml

@@ -1,4 +1,4 @@
-<resources>
+<resources xmlns:tools="http://schemas.android.com/tools">
 
     <!-- Base application theme. -->
     <style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
@@ -16,11 +16,15 @@
         <item name="android:textSize">12sp</item>
     </style>
 
-    <style name="ChipTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
-        <item name="android:textColor">@android:color/white</item>
+    <style name="ChipIncomingTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
+        <item name="android:textColor">@color/nc_incoming_text_default</item>
     </style>
 
-    <style name="ChipAccentTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
+    <style name="ChipOutgoingTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
+        <item name="android:textColor">@color/nc_outcoming_text_default</item>
+    </style>
+
+    <style name="ChipMentionTextAppearance" parent="TextAppearance.MaterialComponents.Chip">
         <item name="android:textColor">@color/colorAccent</item>
     </style>
 

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

@@ -21,6 +21,6 @@
 
 <chip xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
-    android:textAppearance="@style/ChipTextAppearance"
+    android:textAppearance="@style/ChipOutgoingTextAppearance"
     app:chipBackgroundColor="@color/colorAccent"
     app:closeIconEnabled="false"/>

+ 28 - 0
app/src/main/res/xml/chip_incoming_others.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Mario Danic
+  ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<chip xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:textAppearance="@style/ChipIncomingTextAppearance"
+    app:chipStrokeColor="@color/colorAccent"
+    app:chipBackgroundColor="@color/transparent"
+    app:chipStrokeWidth="1dp"
+    app:closeIconEnabled="false" />

+ 28 - 0
app/src/main/res/xml/chip_outgoing_others.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Nextcloud Talk application
+  ~
+  ~ @author Mario Danic
+  ~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
+  ~
+  ~ This program is free software: you can redistribute it and/or modify
+  ~ it under the terms of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ at your option) any later version.
+  ~
+  ~ This program is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  ~ GNU General Public License for more details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  -->
+
+<chip xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:textAppearance="@style/ChipOutgoingTextAppearance"
+    app:chipStrokeColor="@color/white"
+    app:chipBackgroundColor="@color/transparent"
+    app:chipStrokeWidth="1dp"
+    app:closeIconEnabled="false" />

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

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

+ 3 - 1
app/src/main/res/xml/chip_simple_background.xml → app/src/main/res/xml/chip_text_entry.xml

@@ -22,5 +22,7 @@
 <chip xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:textAppearance="@style/ChipAccentTextAppearance"
-    app:chipBackgroundColor="@color/white"
+    app:chipStrokeColor="@color/grey_600"
+    app:chipStrokeWidth="1dp"
+    app:chipBackgroundColor="@color/transparent"
     app:closeIconEnabled="false" />