Update chips colors

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2019-04-17 07:59:27 +02:00
parent 017ee9e034
commit c52d08410d
10 changed files with 74 additions and 12 deletions

View File

@ -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")) {

View File

@ -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(),

View File

@ -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(),

View File

@ -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;

View File

@ -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>

View File

@ -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"/>

View File

@ -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" />

View File

@ -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" />

View File

@ -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" />

View File

@ -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" />