Fix story reply mention fragment from taking over screen.

fork-5.53.8
Cody Henthorne 2022-03-30 13:04:16 -04:00
rodzic 086e3ed4ec
commit 50bea8140f
3 zmienionych plików z 19 dodań i 6 usunięć

Wyświetl plik

@ -88,6 +88,7 @@ class StoryGroupReplyFragment :
private lateinit var recyclerView: RecyclerView
private lateinit var composer: StoryReplyComposer
private var currentChild: StoryViewsAndRepliesPagerParent.Child? = null
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
SignalExecutors.BOUNDED.execute {
@ -204,7 +205,12 @@ class StoryGroupReplyFragment :
}
override fun onPageSelected(child: StoryViewsAndRepliesPagerParent.Child) {
recyclerView.isNestedScrollingEnabled = child == StoryViewsAndRepliesPagerParent.Child.REPLIES
currentChild = child
updateNestedScrolling()
}
private fun updateNestedScrolling() {
recyclerView.isNestedScrollingEnabled = currentChild == StoryViewsAndRepliesPagerParent.Child.REPLIES && !(mentionsViewModel.isShowing.value ?: false)
}
private var resendBody: CharSequence? = null
@ -302,6 +308,8 @@ class StoryGroupReplyFragment :
mentionsViewModel.selectedRecipient.observe(viewLifecycleOwner) { recipient ->
composer.input.replaceTextWithMention(recipient.getDisplayName(requireContext()), recipient.id)
}
mentionsViewModel.isShowing.observe(viewLifecycleOwner) { updateNestedScrolling() }
}
private fun ensureMentionsContainerFilled() {

Wyświetl plik

@ -30,6 +30,16 @@
app:layout_constraintVertical_bias="0"
tools:itemCount="0" />
<androidx.fragment.app.FragmentContainerView
android:id="@+id/mentions_picker_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@+id/composer"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1" />
<org.thoughtcrime.securesms.stories.viewer.reply.composer.StoryReplyComposer
android:id="@+id/composer"
android:layout_width="match_parent"

Wyświetl plik

@ -7,11 +7,6 @@
android:layout_gravity="bottom"
android:orientation="vertical">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/mentions_picker_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include layout="@layout/stories_reply_to_story_composer_content" />
<org.thoughtcrime.securesms.components.emoji.MediaKeyboard