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
b729baf0
Commit
b729baf0
authored
Sep 04, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MessageFormManager.kt
parent
dce4363b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
MessageFormManager.kt
...ocket/android/layouthelper/chatroom/MessageFormManager.kt
+41
-0
No files found.
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageFormManager.kt
0 → 100644
View file @
b729baf0
package
chat.rocket.android.layouthelper.chatroom
import
chat.rocket.android.widget.message.MessageFormLayout
class
MessageFormManager
(
private
val
messageFormLayout
:
MessageFormLayout
,
val
callback
:
MessageFormLayout
.
ExtraActionSelectionClickListener
)
{
private
var
sendMessageCallback
:
SendMessageCallback
?
=
null
init
{
messageFormLayout
.
setExtraActionSelectionClickListener
(
callback
)
messageFormLayout
.
setSubmitTextListener
(
this
::
sendMessage
)
}
fun
setSendMessageCallback
(
sendMessageCallback
:
SendMessageCallback
)
{
this
.
sendMessageCallback
=
sendMessageCallback
}
fun
onMessageSend
()
{
clearComposingText
()
}
fun
setEditMessage
(
message
:
String
)
{
clearComposingText
()
messageFormLayout
.
setText
(
message
)
}
fun
clearComposingText
()
{
messageFormLayout
.
setText
(
""
)
}
fun
enableComposingText
(
enable
:
Boolean
)
{
messageFormLayout
.
isEnabled
=
enable
}
private
fun
sendMessage
(
message
:
String
)
{
sendMessageCallback
?.
onSubmitText
(
message
)
}
interface
SendMessageCallback
{
fun
onSubmitText
(
messageText
:
String
)
}
}
\ No newline at end of file
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