mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-16 09:21:25 +00:00
Added a couple of minor UI optimisations
This commit is contained in:
parent
3e68bdc2f8
commit
afdf730eaa
@ -80,7 +80,7 @@ class LinkPreviewView : LinearLayout {
|
||||
val rawYInt = event.rawY.toInt()
|
||||
val hitRect = Rect(rawXInt, rawYInt, rawXInt, rawYInt)
|
||||
val previewRect = Rect()
|
||||
binding.mainLinkPreviewParent.getGlobalVisibleRect(previewRect)
|
||||
binding.mainLinkPreviewContainer.getGlobalVisibleRect(previewRect)
|
||||
if (previewRect.contains(hitRect)) {
|
||||
openURL()
|
||||
return
|
||||
|
@ -192,6 +192,7 @@ class VisibleMessageView : LinearLayout {
|
||||
binding.dateBreakTextView.text = if (showDateBreak) DateUtils.getDisplayFormattedTimeSpanString(context, Locale.getDefault(), message.timestamp) else null
|
||||
binding.dateBreakTextView.isVisible = showDateBreak
|
||||
// Message status indicator
|
||||
if (message.isOutgoing) {
|
||||
val (iconID, iconColor) = getMessageStatusImage(message)
|
||||
if (iconID != null) {
|
||||
val drawable = ContextCompat.getDrawable(context, iconID)?.mutate()
|
||||
@ -200,7 +201,7 @@ class VisibleMessageView : LinearLayout {
|
||||
}
|
||||
binding.messageStatusImageView.setImageDrawable(drawable)
|
||||
}
|
||||
if (message.isOutgoing) {
|
||||
|
||||
val lastMessageID = mmsSmsDb.getLastMessageID(message.threadId)
|
||||
binding.messageStatusImageView.isVisible =
|
||||
!message.isSent || message.id == lastMessageID
|
||||
@ -213,15 +214,19 @@ class VisibleMessageView : LinearLayout {
|
||||
val emojiLayoutParams = binding.emojiReactionsView.layoutParams as ConstraintLayout.LayoutParams
|
||||
emojiLayoutParams.horizontalBias = if (message.isOutgoing) 1f else 0f
|
||||
binding.emojiReactionsView.layoutParams = emojiLayoutParams
|
||||
|
||||
if (message.reactions.isNotEmpty()) {
|
||||
val capabilities = lokiThreadDb.getOpenGroupChat(threadID)?.server?.let { lokiApiDb.getServerCapabilities(it) }
|
||||
if (message.reactions.isNotEmpty() &&
|
||||
(capabilities.isNullOrEmpty() || capabilities.contains(OpenGroupApi.Capability.REACTIONS.name.lowercase()))
|
||||
) {
|
||||
if (capabilities.isNullOrEmpty() || capabilities.contains(OpenGroupApi.Capability.REACTIONS.name.lowercase())) {
|
||||
binding.emojiReactionsView.setReactions(message.id, message.reactions, message.isOutgoing, delegate)
|
||||
binding.emojiReactionsView.isVisible = true
|
||||
} else {
|
||||
binding.emojiReactionsView.isVisible = false
|
||||
}
|
||||
}
|
||||
else {
|
||||
binding.emojiReactionsView.isVisible = false
|
||||
}
|
||||
|
||||
// Populate content view
|
||||
binding.messageContentView.indexInAdapter = indexInAdapter
|
||||
|
@ -1,16 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:id="@+id/mainLinkPreviewContainer"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/transparent_black_6"
|
||||
android:id="@+id/mainLinkPreviewParent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center">
|
||||
@ -50,5 +44,3 @@
|
||||
android:textColor="?android:textColorPrimary"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
Loading…
x
Reference in New Issue
Block a user