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
baa0ddaf
Commit
baa0ddaf
authored
Dec 23, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
just rename MessageComposer -> MessageFormLayout, MessageComposerManager -> MessageFormManager.
parent
4563ff68
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+6
-6
MessageFormManager.java
...ket/android/layouthelper/chatroom/MessageFormManager.java
+10
-10
fragment_room_main.xml
app/src/main/res/layout/fragment_room_main.xml
+1
-1
MessageFormLayout.java
...chat/rocket/android/widget/message/MessageFormLayout.java
+5
-6
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
baa0ddaf
...
@@ -29,7 +29,7 @@ import chat.rocket.android.helper.LoadMoreScrollListener;
...
@@ -29,7 +29,7 @@ import chat.rocket.android.helper.LoadMoreScrollListener;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.helper.LogcatIfError
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.helper.OnBackPressListener
;
import
chat.rocket.android.helper.TextUtils
;
import
chat.rocket.android.helper.TextUtils
;
import
chat.rocket.android.layouthelper.chatroom.Message
Composer
Manager
;
import
chat.rocket.android.layouthelper.chatroom.Message
Form
Manager
;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.layouthelper.chatroom.MessageListAdapter
;
import
chat.rocket.android.layouthelper.chatroom.PairedMessage
;
import
chat.rocket.android.layouthelper.chatroom.PairedMessage
;
import
chat.rocket.android.log.RCLog
;
import
chat.rocket.android.log.RCLog
;
...
@@ -50,7 +50,7 @@ import chat.rocket.android.realm_helper.RealmModelListAdapter;
...
@@ -50,7 +50,7 @@ import chat.rocket.android.realm_helper.RealmModelListAdapter;
import
chat.rocket.android.realm_helper.RealmObjectObserver
;
import
chat.rocket.android.realm_helper.RealmObjectObserver
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.service.RocketChatService
;
import
chat.rocket.android.service.RocketChatService
;
import
chat.rocket.android.widget.message.Message
Composer
;
import
chat.rocket.android.widget.message.Message
FormLayout
;
import
permissions.dispatcher.NeedsPermission
;
import
permissions.dispatcher.NeedsPermission
;
import
permissions.dispatcher.RuntimePermissions
;
import
permissions.dispatcher.RuntimePermissions
;
...
@@ -70,7 +70,7 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -70,7 +70,7 @@ public class RoomFragment extends AbstractChatRoomFragment
private
String
token
;
private
String
token
;
private
LoadMoreScrollListener
scrollListener
;
private
LoadMoreScrollListener
scrollListener
;
private
RealmObjectObserver
<
LoadMessageProcedure
>
procedureObserver
;
private
RealmObjectObserver
<
LoadMessageProcedure
>
procedureObserver
;
private
Message
Composer
Manager
messageComposerManager
;
private
Message
Form
Manager
messageComposerManager
;
private
MessageSelectionDialogFragment
.
ClickListener
messageSelectionClickListener
=
private
MessageSelectionDialogFragment
.
ClickListener
messageSelectionClickListener
=
messageSpec
->
RoomFragmentPermissionsDispatcher
messageSpec
->
RoomFragmentPermissionsDispatcher
...
@@ -224,9 +224,9 @@ public class RoomFragment extends AbstractChatRoomFragment
...
@@ -224,9 +224,9 @@ public class RoomFragment extends AbstractChatRoomFragment
}
}
private
void
setupMessageComposer
()
{
private
void
setupMessageComposer
()
{
final
Message
Composer
messageComposer
=
final
Message
FormLayout
messageFormLayout
=
(
Message
Composer
)
rootView
.
findViewById
(
R
.
id
.
message_composer
);
(
Message
FormLayout
)
rootView
.
findViewById
(
R
.
id
.
message_composer
);
messageComposerManager
=
new
Message
ComposerManager
(
messageComposer
);
messageComposerManager
=
new
Message
FormManager
(
messageFormLayout
);
messageComposerManager
.
setSendMessageCallback
(
messageText
->
messageComposerManager
.
setSendMessageCallback
(
messageText
->
realmHelper
.
executeTransaction
(
realm
->
realmHelper
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/Message
Composer
Manager.java
→
app/src/main/java/chat/rocket/android/layouthelper/chatroom/Message
Form
Manager.java
View file @
baa0ddaf
package
chat
.
rocket
.
android
.
layouthelper
.
chatroom
;
package
chat
.
rocket
.
android
.
layouthelper
.
chatroom
;
import
bolts.Task
;
import
bolts.Task
;
import
chat.rocket.android.widget.message.Message
Composer
;
import
chat.rocket.android.widget.message.Message
FormLayout
;
/**
/**
* handling
visibility of FAB-compose and MessageComposer
.
* handling
MessageForm
.
*/
*/
public
class
Message
Composer
Manager
{
public
class
Message
Form
Manager
{
private
final
Message
Composer
messageComposer
;
private
final
Message
FormLayout
messageFormLayout
;
private
SendMessageCallback
sendMessageCallback
;
private
SendMessageCallback
sendMessageCallback
;
private
ExtrasPickerListener
extrasPickerListener
;
private
ExtrasPickerListener
extrasPickerListener
;
public
Message
ComposerManager
(
MessageComposer
messageComposer
)
{
public
Message
FormManager
(
MessageFormLayout
messageFormLayout
)
{
this
.
message
Composer
=
messageComposer
;
this
.
message
FormLayout
=
messageFormLayout
;
init
();
init
();
}
}
private
void
init
()
{
private
void
init
()
{
message
Composer
.
setOnActionListener
(
new
MessageComposer
.
ActionListener
()
{
message
FormLayout
.
setOnActionListener
(
new
MessageFormLayout
.
ActionListener
()
{
@Override
@Override
public
void
onSubmit
(
String
message
)
{
public
void
onSubmit
(
String
message
)
{
sendMessage
(
message
);
sendMessage
(
message
);
...
@@ -43,7 +43,7 @@ public class MessageComposerManager {
...
@@ -43,7 +43,7 @@ public class MessageComposerManager {
}
}
public
void
clearComposingText
()
{
public
void
clearComposingText
()
{
message
Composer
.
setText
(
""
);
message
FormLayout
.
setText
(
""
);
}
}
private
void
sendMessage
(
String
message
)
{
private
void
sendMessage
(
String
message
)
{
...
@@ -51,12 +51,12 @@ public class MessageComposerManager {
...
@@ -51,12 +51,12 @@ public class MessageComposerManager {
return
;
return
;
}
}
message
Composer
.
setEnabled
(
false
);
message
FormLayout
.
setEnabled
(
false
);
sendMessageCallback
.
onSubmit
(
message
).
onSuccess
(
task
->
{
sendMessageCallback
.
onSubmit
(
message
).
onSuccess
(
task
->
{
clearComposingText
();
clearComposingText
();
return
null
;
return
null
;
}).
continueWith
(
task
->
{
}).
continueWith
(
task
->
{
message
Composer
.
setEnabled
(
true
);
message
FormLayout
.
setEnabled
(
true
);
return
null
;
return
null
;
});
});
}
}
...
...
app/src/main/res/layout/fragment_room_main.xml
View file @
baa0ddaf
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@+id/message_composer"
/>
android:layout_above=
"@+id/message_composer"
/>
<chat.rocket.android.widget.message.Message
Composer
<chat.rocket.android.widget.message.Message
FormLayout
android:id=
"@+id/message_composer"
android:id=
"@+id/message_composer"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/Message
Composer
.java
→
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/message/Message
FormLayout
.java
View file @
baa0ddaf
...
@@ -11,14 +11,13 @@ import android.util.AttributeSet;
...
@@ -11,14 +11,13 @@ import android.util.AttributeSet;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
chat.rocket.android.widget.R
;
import
chat.rocket.android.widget.R
;
public
class
Message
Composer
extends
LinearLayout
{
public
class
Message
FormLayout
extends
LinearLayout
{
protected
ActionListener
actionListener
;
protected
ActionListener
actionListener
;
protected
ViewGroup
composer
;
protected
ViewGroup
composer
;
...
@@ -26,23 +25,23 @@ public class MessageComposer extends LinearLayout {
...
@@ -26,23 +25,23 @@ public class MessageComposer extends LinearLayout {
private
View
btnExtra
;
private
View
btnExtra
;
private
View
btnSubmit
;
private
View
btnSubmit
;
public
Message
Composer
(
Context
context
)
{
public
Message
FormLayout
(
Context
context
)
{
super
(
context
);
super
(
context
);
init
();
init
();
}
}
public
Message
Composer
(
Context
context
,
AttributeSet
attrs
)
{
public
Message
FormLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
super
(
context
,
attrs
);
init
();
init
();
}
}
public
Message
Composer
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
Message
FormLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
super
(
context
,
attrs
,
defStyleAttr
);
init
();
init
();
}
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
Message
Composer
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
public
Message
FormLayout
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
init
();
init
();
}
}
...
...
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