From fcb627aac64c020d07529046b7f3b0a9d85b7cc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 2 Apr 2020 15:38:16 +0200 Subject: [PATCH] [Messages/Compose] Fix underlined word under the caret. --- .../ui/modules/messages/MessagesComposeFragment.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeFragment.kt index 7326a653..78097956 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeFragment.kt @@ -433,6 +433,15 @@ class MessagesComposeFragment : Fragment(), CoroutineScope { return } + // do magic + // apparently this removes an underline + // span from the text where the caret is + b.subject.requestFocus() + b.subject.clearFocus() + activity.navView.bottomSheet.hideKeyboard() + b.text.clearFocus() + b.text.setSelection(0) + if (b.subjectLayout.counterMaxLength != -1 && b.subject.length() > b.subjectLayout.counterMaxLength) return if (b.textLayout.counterMaxLength != -1 && b.text.length() > b.textLayout.counterMaxLength)