mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-15 16:55:03 +01:00
Merge pull request #897 from dan0xii/834-text-contrast
Improves visiblity of text and URLs in chat view.
This commit is contained in:
commit
30349b53d3
@ -29,6 +29,7 @@ import kotlinx.android.synthetic.main.item_message_quote.view.*
|
||||
import kotlinx.android.synthetic.main.rv_chat_item.view.*
|
||||
import kotlinx.android.synthetic.main.rv_chat_system_item.view.*
|
||||
import kotlinx.android.synthetic.main.rv_date_and_unread_notice_item.view.*
|
||||
import kotlinx.android.synthetic.main.rv_item_conversation_with_last_message.view.*
|
||||
import org.koin.core.KoinComponent
|
||||
|
||||
open class ChatPresenter<T : Any>(context: Context, private val onElementClickPass: ((Page, Holder, Element<T>, Map<String, String>) -> Unit)?, private val onElementLongClick: ((Page, Holder, Element<T>, Map<String, String>) -> Unit)?, private val imageLoader: ImageLoaderInterface) : Presenter<T>(context), KoinComponent {
|
||||
@ -147,9 +148,14 @@ open class ChatPresenter<T : Any>(context: Context, private val onElementClickPa
|
||||
if (isOutgoingMessage) {
|
||||
messageLayoutParams.marginEnd = 8.dp
|
||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.outgoing_grouped_message_background)
|
||||
holder.itemView.chatMessage.setTextColor(context.resources.getColor(R.color.fg_chat_message_sent))
|
||||
holder.itemView.messageTime.setTextColor(context.resources.getColor(R.color.fg_default_high))
|
||||
holder.itemView.chatMessage.setLinkTextColor(context.resources.getColor(R.color.fg_chat_message_url))
|
||||
} else {
|
||||
messageLayoutParams.marginStart = 40.dp
|
||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.incoming_grouped_message_background)
|
||||
holder.itemView.chatMessage.setTextColor(context.resources.getColor(R.color.fg_default))
|
||||
holder.itemView.chatMessage.setLinkTextColor(context.resources.getColor(R.color.colorPrimary))
|
||||
}
|
||||
holder.itemView.messageLayout.layoutParams = messageLayoutParams
|
||||
|
||||
@ -158,9 +164,14 @@ open class ChatPresenter<T : Any>(context: Context, private val onElementClickPa
|
||||
if (isOutgoingMessage) {
|
||||
messageLayoutParams.marginEnd = 8.dp
|
||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.outgoing_message_background)
|
||||
holder.itemView.chatMessage.setTextColor(context.resources.getColor(R.color.fg_chat_message_sent))
|
||||
holder.itemView.messageTime.setTextColor(context.resources.getColor(R.color.fg_default_high))
|
||||
holder.itemView.chatMessage.setLinkTextColor(context.resources.getColor(R.color.fg_chat_message_url))
|
||||
} else {
|
||||
messageLayoutParams.marginStart = 0
|
||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.incoming_message_background)
|
||||
holder.itemView.chatMessage.setTextColor(context.resources.getColor(R.color.fg_default))
|
||||
holder.itemView.chatMessage.setLinkTextColor(context.resources.getColor(R.color.colorPrimary))
|
||||
}
|
||||
|
||||
holder.itemView.messageLayout.layoutParams = messageLayoutParams
|
||||
@ -209,6 +220,10 @@ open class ChatPresenter<T : Any>(context: Context, private val onElementClickPa
|
||||
holder.itemView.quotedMessageTime?.text = DateFormatter.format(it.createdAt, DateFormatter.Template.TIME)
|
||||
if (isOutgoingMessage) {
|
||||
holder.itemView.quoteColoredView.setBackgroundColor(context.resources.getColor(R.color.bg_message_list_incoming_bubble))
|
||||
holder.itemView.quotedChatText.setTextColor(context.resources.getColor(R.color.fg_chat_message_sent))
|
||||
holder.itemView.quotedMessageTime.setTextColor(context.resources.getColor(R.color.fg_default_high))
|
||||
holder.itemView.quotedChatText.setLinkTextColor(context.resources.getColor(R.color.fg_chat_message_url))
|
||||
holder.itemView.quotedAuthor.setTextColor(context.resources.getColor(R.color.fg_chat_message_sent))
|
||||
} else {
|
||||
holder.itemView.quoteColoredView.setBackgroundColor(context.resources.getColor(R.color.bg_message_list_outcoming_bubble))
|
||||
}
|
||||
|
@ -65,6 +65,7 @@
|
||||
android:textIsSelectable="false"
|
||||
android:autoLink="all"
|
||||
android:textSize="14sp"
|
||||
android:textColorLink="@color/colorPrimary"
|
||||
tools:text="Just another chat message" />
|
||||
|
||||
<TextView
|
||||
|
@ -74,6 +74,8 @@
|
||||
android:layout_marginHorizontal="8dp"
|
||||
android:id="@+id/chatMessage"
|
||||
android:autoLink="all"
|
||||
android:textColor="@color/fg_chat_message_sent"
|
||||
android:textColorLink="@color/colorPrimary"
|
||||
app:layout_alignSelf="flex_start"
|
||||
app:layout_flexGrow="1"
|
||||
app:layout_wrapBefore="true"
|
||||
|
@ -25,6 +25,10 @@
|
||||
<bool name="is_night">true</bool>
|
||||
<bool name="status_bar_light">false</bool>
|
||||
|
||||
<color name="colorPrimary">#0082C9</color>
|
||||
<color name="colorPrimaryDark">#006AA3</color>
|
||||
<color name="colorAccent">#007CC2</color>
|
||||
|
||||
<color name="conversation_item_header">#9FBDCC</color>
|
||||
<!--<color name="conversation_item_header">#CFCFCF</color>-->
|
||||
|
||||
@ -34,6 +38,7 @@
|
||||
|
||||
<color name="fg_default">#FFFFFF</color>
|
||||
<color name="fg_inverse">#222222</color>
|
||||
<color name="fg_chat_message_sent">@color/fg_default</color>
|
||||
|
||||
<!-- Chat window incoming message text & informational -->
|
||||
<color name="nc_incoming_text_default">#D8D8D8</color>
|
||||
|
@ -59,6 +59,9 @@
|
||||
|
||||
<color name="fg_default">#666666</color>
|
||||
<color name="fg_inverse">#FFFFFF</color>
|
||||
<color name="fg_chat_message_sent">#FFFFFF</color>
|
||||
<color name="fg_chat_message_url">#dddddd</color>
|
||||
<color name="fg_default_high">#cccccc</color>
|
||||
|
||||
<color name="bg_default">#FFFFFF</color>
|
||||
<color name="bg_alt">@color/white60</color>
|
||||
|
Loading…
Reference in New Issue
Block a user