fix: add UI test for URL modal dialog and fix mention infinite layout inflation bugs (#841)

This commit is contained in:
Harris
2022-02-09 14:18:22 +11:00
committed by GitHub
parent 07ccc2696b
commit b01075cef6
5 changed files with 86 additions and 17 deletions

View File

@@ -622,6 +622,9 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val query = text.substring(currentMentionStartIndex + 1) // + 1 to get rid of the "@"
showOrUpdateMentionCandidatesIfNeeded(query)
}
} else {
currentMentionStartIndex = -1
hideMentionCandidates()
}
previousText = text
}
@@ -636,13 +639,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity(), InputBarDe
val candidates = MentionsManager.getMentionCandidates(query, viewModel.threadId, viewModel.recipient.isOpenGroupRecipient)
this.mentionCandidatesView = view
view.show(candidates, viewModel.threadId)
view.alpha = 0.0f
val animation = ValueAnimator.ofObject(FloatEvaluator(), view.alpha, 1.0f)
animation.duration = 250L
animation.addUpdateListener { animator ->
view.alpha = animator.animatedValue as Float
}
animation.start()
} else {
val candidates = MentionsManager.getMentionCandidates(query, viewModel.threadId, viewModel.recipient.isOpenGroupRecipient)
this.mentionCandidatesView!!.setMentionCandidates(candidates)

View File

@@ -93,6 +93,7 @@ class VisibleMessageContentView : LinearLayout {
binding.quoteView.isVisible = message is MmsMessageRecord && message.quote != null
binding.linkPreviewView.isVisible = message is MmsMessageRecord && message.linkPreviews.isNotEmpty()
binding.linkPreviewView.bodyTextView = binding.bodyTextView
val linkPreviewLayout = binding.linkPreviewView.layoutParams
linkPreviewLayout.width = if (mediaThumbnailMessage) 0 else ViewGroup.LayoutParams.WRAP_CONTENT

View File

@@ -16,9 +16,9 @@
<org.thoughtcrime.securesms.conversation.v2.ConversationRecyclerView
android:id="@+id/conversationRecyclerView"
android:layout_above="@+id/typingIndicatorViewContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"
android:layout_above="@+id/typingIndicatorViewContainer" />
<org.thoughtcrime.securesms.conversation.v2.components.TypingIndicatorViewContainer
android:id="@+id/typingIndicatorViewContainer"
@@ -45,8 +45,7 @@
android:id="@+id/additionalContentContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/input_bar_height" />
android:layout_alignBottom="@+id/conversationRecyclerView"/>
<LinearLayout
android:id="@+id/attachmentOptionsContainer"

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<org.thoughtcrime.securesms.conversation.v2.input_bar.mentions.MentionCandidateView
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="44dp"
@@ -51,4 +51,4 @@
android:layout_alignParentTop="true"
android:background="@color/separator" />
</org.thoughtcrime.securesms.conversation.v2.input_bar.mentions.MentionCandidateView>
</RelativeLayout>