Notices transparent as done on desktop

Change-Id: I4768180eebcaa82bc64e5dcca9694ba808467d94
This commit is contained in:
SpiritCroc 2021-12-23 17:35:07 +01:00
parent f3874be337
commit e8a2b14055
12 changed files with 16 additions and 501 deletions

View File

@ -85,11 +85,13 @@ function create_msg_bubble() {
for is_outgoing in 0 1; do
for is_rtl in 0 1; do
for is_notice in 0 1; do
# Notices are handled via transparency and do not need own drawables right now
is_notice=0
#for is_notice in 0 1; do
for has_tail in 0 1; do
create_msg_bubble "$is_outgoing" "$is_rtl" "$is_notice" "$has_tail"
done
done
#done
done
done

View File

@ -456,22 +456,7 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : AbsBaseMessageItem<H>
val longPadding: Int
val shortPadding: Int
if (BubbleThemeUtils.drawsActualBubbles(bubbleStyle)) {
val bubbleRes = if (attributes.isNotice) { // notice
if (attributes.informationData.showInformation) { // tail
if (reverseBubble) { // outgoing
R.drawable.msg_bubble_notice_outgoing
} else { // incoming
R.drawable.msg_bubble_notice_incoming
}
} else { // notail
if (reverseBubble) { // outgoing
R.drawable.msg_bubble_notice_outgoing_notail
} else { // incoming
R.drawable.msg_bubble_notice_incoming_notail
}
}
} else { // text
if (attributes.informationData.showInformation) { // tail
val bubbleRes = if (attributes.informationData.showInformation) { // tail
if (reverseBubble) { // outgoing
R.drawable.msg_bubble_text_outgoing
} else { // incoming
@ -484,8 +469,8 @@ abstract class AbsMessageItem<H : AbsMessageItem.Holder> : AbsBaseMessageItem<H>
R.drawable.msg_bubble_text_incoming_notail
}
}
}
bubbleView.setBackgroundResource(bubbleRes)
bubbleView.alpha = if (attributes.isNotice) 0.6f else 1f
longPadding = 20
shortPadding = 8
} else {

View File

@ -121,10 +121,6 @@ abstract class MessageTextItem : AbsMessageItem<MessageTextItem.Holder>() {
holder.messageView.onClick(attributes.itemClickListener)
holder.messageView.onLongClickIgnoringLinks(attributes.itemLongClickListener)
holder.messageView.setTextColor(ColorProvider(holder.messageView.context).getColorFromAttribute(
if (attributes.isNotice) R.attr.vctr_content_secondary else R.attr.vctr_content_primary
))
if (bindingOptions?.canUseTextFuture.orFalse()) {
holder.messageView.setTextFuture(textFuture)
} else {

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for tail -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_incoming" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Outer radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Inner radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius_in_tail" />
</shape>
</item>
<!-- Radius end -->
<!-- Tail -->
<item
android:gravity="top|right">
<vector
android:width="@dimen/sc_bubble_tail_size"
android:height="@dimen/sc_bubble_tail_size"
android:viewportWidth="10.0"
android:viewportHeight="10.0">
<path
android:pathData="M10,0 L0,10 L0,0 Z"
android:fillColor="?sc_message_bg_incoming" />
<!-- tail end -->
</vector>
</item>
<!-- Tail end -->
</layer-list>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for no tail -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_incoming" />
<corners android:radius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Filled end -->
<!-- Inner radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Radius end -->
</layer-list>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for tail -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_outgoing" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Outer radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Inner radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius_in_tail" />
</shape>
</item>
<!-- Radius end -->
<!-- Tail -->
<item
android:gravity="top|left">
<vector
android:width="@dimen/sc_bubble_tail_size"
android:height="@dimen/sc_bubble_tail_size"
android:viewportWidth="10.0"
android:viewportHeight="10.0">
<!-- LTR tail -->
<path
android:pathData="M0,0 L10,10 L10,0 Z"
android:fillColor="?sc_message_bg_outgoing" />
</vector>
</item>
<!-- Tail end -->
</layer-list>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for no tail -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_outgoing" />
<corners android:radius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Filled end -->
<!-- Inner radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Radius end -->
</layer-list>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for tail -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_incoming" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Outer radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Inner radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius_in_tail" />
</shape>
</item>
<!-- Radius end -->
<!-- Tail -->
<item
android:gravity="top|left">
<vector
android:width="@dimen/sc_bubble_tail_size"
android:height="@dimen/sc_bubble_tail_size"
android:viewportWidth="10.0"
android:viewportHeight="10.0">
<!-- LTR tail -->
<path
android:pathData="M0,0 L10,10 L10,0 Z"
android:fillColor="?sc_message_bg_incoming" />
</vector>
</item>
<!-- Tail end -->
</layer-list>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for no tail -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_incoming" />
<corners android:radius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Filled end -->
<!-- Inner radius -->
<item android:left="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_incoming"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:bottomRightRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Radius end -->
</layer-list>

View File

@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for tail -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_outgoing" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Outer radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Inner radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius_in_tail" />
</shape>
</item>
<!-- Radius end -->
<!-- Tail -->
<item
android:gravity="top|right">
<vector
android:width="@dimen/sc_bubble_tail_size"
android:height="@dimen/sc_bubble_tail_size"
android:viewportWidth="10.0"
android:viewportHeight="10.0">
<path
android:pathData="M10,0 L0,10 L0,0 Z"
android:fillColor="?sc_message_bg_outgoing" />
<!-- tail end -->
</vector>
</item>
<!-- Tail end -->
</layer-list>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
IMPORTANT:
Only modify msg_godbubble.xml, then run `generate_bubbles.sh` to update all actually used msg_bubble_*.xml drawables.
Note also that most of the comments should not be changed without checking their use in `generate_bubbles.sh`.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Filled for no tail -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<solid android:color="?sc_notice_bg_outgoing" />
<corners android:radius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Filled end -->
<!-- Inner radius -->
<item android:right="@dimen/sc_bubble_tail_size">
<shape
android:shape="rectangle">
<stroke android:color="?sc_message_bg_outgoing"
android:width="@dimen/sc_bubble_stroke" />
<corners android:bottomRightRadius="@dimen/sc_bubble_radius"
android:bottomLeftRadius="@dimen/sc_bubble_radius"
android:topLeftRadius="@dimen/sc_bubble_radius"
android:topRightRadius="@dimen/sc_bubble_radius" />
</shape>
</item>
<!-- Radius end -->
</layer-list>

View File

@ -20,8 +20,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:textColor="?vctr_content_primary"
android:layout_gravity="left"
tools:textColor="?vctr_content_primary"
tools:text="@sample/messages.json/data/message"
tools:ignore="RtlHardcoded" />