mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-16 09:15:30 +01:00
Improves visiblity of text and URLs in chat view.
Signed-off-by: Daniel Bailey <daniel.bailey@grappleIT.co.uk>
This commit is contained in:
parent
3170aebab3
commit
f43a6ff15f
@ -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_item.view.*
|
||||||
import kotlinx.android.synthetic.main.rv_chat_system_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_date_and_unread_notice_item.view.*
|
||||||
|
import kotlinx.android.synthetic.main.rv_item_conversation_with_last_message.view.*
|
||||||
import org.koin.core.KoinComponent
|
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 {
|
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) {
|
if (isOutgoingMessage) {
|
||||||
messageLayoutParams.marginEnd = 8.dp
|
messageLayoutParams.marginEnd = 8.dp
|
||||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.outgoing_grouped_message_background)
|
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 {
|
} else {
|
||||||
messageLayoutParams.marginStart = 40.dp
|
messageLayoutParams.marginStart = 40.dp
|
||||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.incoming_grouped_message_background)
|
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
|
holder.itemView.messageLayout.layoutParams = messageLayoutParams
|
||||||
|
|
||||||
@ -158,9 +164,14 @@ open class ChatPresenter<T : Any>(context: Context, private val onElementClickPa
|
|||||||
if (isOutgoingMessage) {
|
if (isOutgoingMessage) {
|
||||||
messageLayoutParams.marginEnd = 8.dp
|
messageLayoutParams.marginEnd = 8.dp
|
||||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.outgoing_message_background)
|
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 {
|
} else {
|
||||||
messageLayoutParams.marginStart = 0
|
messageLayoutParams.marginStart = 0
|
||||||
holder.itemView.messageLayout.background = context.resources.getDrawable(R.drawable.incoming_message_background)
|
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
|
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)
|
holder.itemView.quotedMessageTime?.text = DateFormatter.format(it.createdAt, DateFormatter.Template.TIME)
|
||||||
if (isOutgoingMessage) {
|
if (isOutgoingMessage) {
|
||||||
holder.itemView.quoteColoredView.setBackgroundColor(context.resources.getColor(R.color.bg_message_list_incoming_bubble))
|
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 {
|
} else {
|
||||||
holder.itemView.quoteColoredView.setBackgroundColor(context.resources.getColor(R.color.bg_message_list_outcoming_bubble))
|
holder.itemView.quoteColoredView.setBackgroundColor(context.resources.getColor(R.color.bg_message_list_outcoming_bubble))
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@
|
|||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:autoLink="all"
|
android:autoLink="all"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
|
android:textColorLink="@color/colorPrimary"
|
||||||
tools:text="Just another chat message" />
|
tools:text="Just another chat message" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -74,6 +74,8 @@
|
|||||||
android:layout_marginHorizontal="8dp"
|
android:layout_marginHorizontal="8dp"
|
||||||
android:id="@+id/chatMessage"
|
android:id="@+id/chatMessage"
|
||||||
android:autoLink="all"
|
android:autoLink="all"
|
||||||
|
android:textColor="@color/fg_chat_message_sent"
|
||||||
|
android:textColorLink="@color/colorPrimary"
|
||||||
app:layout_alignSelf="flex_start"
|
app:layout_alignSelf="flex_start"
|
||||||
app:layout_flexGrow="1"
|
app:layout_flexGrow="1"
|
||||||
app:layout_wrapBefore="true"
|
app:layout_wrapBefore="true"
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
<bool name="is_night">true</bool>
|
<bool name="is_night">true</bool>
|
||||||
<bool name="status_bar_light">false</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">#9FBDCC</color>
|
||||||
<!--<color name="conversation_item_header">#CFCFCF</color>-->
|
<!--<color name="conversation_item_header">#CFCFCF</color>-->
|
||||||
|
|
||||||
@ -34,6 +38,7 @@
|
|||||||
|
|
||||||
<color name="fg_default">#FFFFFF</color>
|
<color name="fg_default">#FFFFFF</color>
|
||||||
<color name="fg_inverse">#222222</color>
|
<color name="fg_inverse">#222222</color>
|
||||||
|
<color name="fg_chat_message_sent">@color/fg_default</color>
|
||||||
|
|
||||||
<!-- Chat window incoming message text & informational -->
|
<!-- Chat window incoming message text & informational -->
|
||||||
<color name="nc_incoming_text_default">#D8D8D8</color>
|
<color name="nc_incoming_text_default">#D8D8D8</color>
|
||||||
|
@ -59,6 +59,9 @@
|
|||||||
|
|
||||||
<color name="fg_default">#666666</color>
|
<color name="fg_default">#666666</color>
|
||||||
<color name="fg_inverse">#FFFFFF</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_default">#FFFFFF</color>
|
||||||
<color name="bg_alt">@color/white60</color>
|
<color name="bg_alt">@color/white60</color>
|
||||||
|
Loading…
Reference in New Issue
Block a user