Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
79588c77
Commit
79588c77
authored
Oct 06, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide keyboard on cancel reply
parent
d36acffa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
MessageFormManager.kt
...ocket/android/layouthelper/chatroom/MessageFormManager.kt
+1
-2
MessageFormLayout.java
...chat/rocket/android/widget/message/MessageFormLayout.java
+12
-0
No files found.
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageFormManager.kt
View file @
79588c77
package
chat.rocket.android.layouthelper.chatroom
package
chat.rocket.android.layouthelper.chatroom
import
android.text.TextUtils
import
android.view.View
import
chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.android.widget.AbsoluteUrl
import
chat.rocket.android.widget.message.MessageFormLayout
import
chat.rocket.android.widget.message.MessageFormLayout
import
chat.rocket.core.models.Message
import
chat.rocket.core.models.Message
...
@@ -42,6 +40,7 @@ class MessageFormManager(private val messageFormLayout: MessageFormLayout, val c
...
@@ -42,6 +40,7 @@ class MessageFormManager(private val messageFormLayout: MessageFormLayout, val c
messageFormLayout
.
setReplyCancelListener
({
messageFormLayout
.
setReplyCancelListener
({
this
.
replyMarkDown
=
""
this
.
replyMarkDown
=
""
messageFormLayout
.
clearReplyContent
()
messageFormLayout
.
clearReplyContent
()
messageFormLayout
.
hideKeyboard
()
})
})
}
}
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/MessageFormLayout.java
View file @
79588c77
...
@@ -238,6 +238,18 @@ public class MessageFormLayout extends LinearLayout {
...
@@ -238,6 +238,18 @@ public class MessageFormLayout extends LinearLayout {
requestFocusAndShowKeyboard
();
requestFocusAndShowKeyboard
();
}
}
public
void
hideKeyboard
()
{
final
EditText
editor
=
getEditor
();
editor
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
InputMethodManager
inputMethodManager
=
(
InputMethodManager
)
editor
.
getContext
()
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
inputMethodManager
.
hideSoftInputFromWindow
(
editor
.
getWindowToken
(),
0
);
}
});
}
private
void
requestFocusAndShowKeyboard
()
{
private
void
requestFocusAndShowKeyboard
()
{
final
EditText
editor
=
getEditor
();
final
EditText
editor
=
getEditor
();
editor
.
post
(
new
Runnable
()
{
editor
.
post
(
new
Runnable
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment