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
f45625b3
Commit
f45625b3
authored
Jan 25, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes
parent
8f037814
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+4
-6
MessageFormLayout.java
...chat/rocket/android/widget/message/MessageFormLayout.java
+8
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
f45625b3
...
@@ -27,6 +27,7 @@ import java.lang.reflect.Field;
...
@@ -27,6 +27,7 @@ import java.lang.reflect.Field;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.UUID
;
import
bolts.Task
;
import
chat.rocket.android.R
;
import
chat.rocket.android.R
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment
;
import
chat.rocket.android.fragment.chatroom.dialog.FileUploadProgressDialogFragment
;
...
@@ -322,10 +323,7 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -322,10 +323,7 @@ public class RoomFragment extends AbstractChatRoomFragment
(
MessageFormLayout
)
rootView
.
findViewById
(
R
.
id
.
message_composer
);
(
MessageFormLayout
)
rootView
.
findViewById
(
R
.
id
.
message_composer
);
messageFormManager
=
messageFormManager
=
new
MessageFormManager
(
messageFormLayout
,
this
::
showExtraActionSelectionDialog
);
new
MessageFormManager
(
messageFormLayout
,
this
::
showExtraActionSelectionDialog
);
messageFormManager
.
setSendMessageCallback
(
messageText
->
{
messageFormManager
.
setSendMessageCallback
(
this
::
sendMessage
);
sendMessage
(
messageText
);
return
null
;
});
messageFormLayout
.
setEditTextContentListener
(
this
::
onCommitContent
);
messageFormLayout
.
setEditTextContentListener
(
this
::
onCommitContent
);
}
}
...
@@ -529,8 +527,8 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -529,8 +527,8 @@ public class RoomFragment extends AbstractChatRoomFragment
return
true
;
return
true
;
}
}
private
void
sendMessage
(
String
messageText
)
{
private
Task
<
Void
>
sendMessage
(
String
messageText
)
{
realmHelper
.
executeTransaction
(
realm
->
re
turn
re
almHelper
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
.
put
(
Message
.
ID
,
UUID
.
randomUUID
().
toString
())
.
put
(
Message
.
ID
,
UUID
.
randomUUID
().
toString
())
.
put
(
Message
.
SYNC_STATE
,
SyncState
.
NOT_SYNCED
)
.
put
(
Message
.
SYNC_STATE
,
SyncState
.
NOT_SYNCED
)
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/MessageFormLayout.java
View file @
f45625b3
...
@@ -139,8 +139,14 @@ public class MessageFormLayout extends LinearLayout {
...
@@ -139,8 +139,14 @@ public class MessageFormLayout extends LinearLayout {
return
getEditor
().
getText
().
toString
().
trim
();
return
getEditor
().
getText
().
toString
().
trim
();
}
}
public
final
void
setText
(
CharSequence
text
)
{
public
final
void
setText
(
final
CharSequence
text
)
{
getEditor
().
setText
(
text
);
final
TextView
editor
=
getEditor
();
editor
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
editor
.
setText
(
text
);
}
});
}
}
public
void
setEnabled
(
boolean
enabled
)
{
public
void
setEnabled
(
boolean
enabled
)
{
...
...
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