mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Fix text story keyboard in text stories.
This commit is contained in:
@@ -71,7 +71,7 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
|
||||
|
||||
_binding = StoriesTextPostCreationFragmentBinding.bind(view)
|
||||
|
||||
binding.storyTextPost.showCloseButton()
|
||||
binding.storyTextPost.enableCreationMode()
|
||||
|
||||
lifecycleDisposable.bindTo(viewLifecycleOwner)
|
||||
lifecycleDisposable += sharedViewModel.hudCommands.subscribe {
|
||||
@@ -137,7 +137,7 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
|
||||
binding.send.isClickable = false
|
||||
binding.sendInProgressIndicator.visible = true
|
||||
|
||||
binding.storyTextPost.hideCloseButton()
|
||||
binding.storyTextPost.disableCreationMode()
|
||||
|
||||
val contacts = (sharedViewModel.destination.getRecipientSearchKeyList() + sharedViewModel.destination.getRecipientSearchKey())
|
||||
.filterIsInstance(ContactSearchKey::class.java)
|
||||
@@ -174,7 +174,7 @@ class TextStoryPostCreationFragment : Fragment(R.layout.stories_text_post_creati
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
binding.storyTextPost.showCloseButton()
|
||||
binding.storyTextPost.enableCreationMode()
|
||||
requireActivity().requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class StoryTextPostView @JvmOverloads constructor(
|
||||
|
||||
init {
|
||||
TextStoryTextWatcher.install(textView)
|
||||
textView.movementMethod = LongClickMovementMethod.getInstance(context)
|
||||
disableCreationMode()
|
||||
}
|
||||
|
||||
fun getLinkPreviewThumbnailWidth(useLargeThumbnail: Boolean): Int {
|
||||
@@ -59,12 +59,14 @@ class StoryTextPostView @JvmOverloads constructor(
|
||||
return linkPreviewView.getThumbnailViewHeight(useLargeThumbnail)
|
||||
}
|
||||
|
||||
fun showCloseButton() {
|
||||
fun enableCreationMode() {
|
||||
linkPreviewView.setCanClose(true)
|
||||
textView.movementMethod = null
|
||||
}
|
||||
|
||||
fun hideCloseButton() {
|
||||
fun disableCreationMode() {
|
||||
linkPreviewView.setCanClose(false)
|
||||
textView.movementMethod = LongClickMovementMethod.getInstance(context)
|
||||
}
|
||||
|
||||
fun setTypeface(typeface: Typeface) {
|
||||
@@ -144,7 +146,7 @@ class StoryTextPostView @JvmOverloads constructor(
|
||||
setTextColor(storyTextPost.textForegroundColor, false)
|
||||
setTextBackgroundColor(storyTextPost.textBackgroundColor)
|
||||
|
||||
hideCloseButton()
|
||||
disableCreationMode()
|
||||
|
||||
postAdjustLinkPreviewTranslationY()
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import org.thoughtcrime.securesms.R;
|
||||
|
||||
Reference in New Issue
Block a user