mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-22 18:55:12 +00:00
Pop open keyboard when we enter the link entry fragment.
This commit is contained in:
committed by
Cody Henthorne
parent
0fcbb5ffda
commit
f06f0e7ae0
@@ -12,12 +12,15 @@ import org.thoughtcrime.securesms.components.KeyboardEntryDialogFragment
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreviewRepository
|
||||
import org.thoughtcrime.securesms.linkpreview.LinkPreviewViewModel
|
||||
import org.thoughtcrime.securesms.stories.StoryLinkPreviewView
|
||||
import org.thoughtcrime.securesms.util.ViewUtil
|
||||
import org.thoughtcrime.securesms.util.visible
|
||||
|
||||
class TextStoryPostLinkEntryFragment : KeyboardEntryDialogFragment(
|
||||
contentLayoutId = R.layout.stories_text_post_link_entry_fragment
|
||||
) {
|
||||
|
||||
private lateinit var input: EditText
|
||||
|
||||
private val linkPreviewViewModel: LinkPreviewViewModel by viewModels(
|
||||
factoryProducer = { LinkPreviewViewModel.Factory(LinkPreviewRepository()) }
|
||||
)
|
||||
@@ -29,7 +32,8 @@ class TextStoryPostLinkEntryFragment : KeyboardEntryDialogFragment(
|
||||
)
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
val input: EditText = view.findViewById(R.id.input)
|
||||
input = view.findViewById(R.id.input)
|
||||
|
||||
val linkPreview: StoryLinkPreviewView = view.findViewById(R.id.link_preview)
|
||||
val confirmButton: View = view.findViewById(R.id.confirm_button)
|
||||
|
||||
@@ -56,6 +60,11 @@ class TextStoryPostLinkEntryFragment : KeyboardEntryDialogFragment(
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
ViewUtil.focusAndShowKeyboard(input)
|
||||
}
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
linkPreviewViewModel.onSend()
|
||||
super.onDismiss(dialog)
|
||||
|
||||
Reference in New Issue
Block a user