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
31b29aba
Commit
31b29aba
authored
Feb 19, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds subscribeTextMessage funtion.
for a better in class modularization.
parent
4a86cd34
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+22
-17
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
31b29aba
...
@@ -255,21 +255,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -255,21 +255,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
text_room_is_read_only
.
setVisible
(
true
)
text_room_is_read_only
.
setVisible
(
true
)
input_container
.
setVisible
(
false
)
input_container
.
setVisible
(
false
)
}
else
{
}
else
{
var
playAnimation
=
true
subscribeTextMessage
()
text_message
.
asObservable
(
0
)
.
subscribe
({
t
->
if
(
t
.
isNotEmpty
()
&&
playAnimation
)
{
button_show_attachment_options
.
fadeInOrOut
(
1F
,
0F
,
120
)
button_send
.
fadeInOrOut
(
0F
,
1F
,
120
)
playAnimation
=
false
}
if
(
t
.
isEmpty
())
{
button_send
.
fadeInOrOut
(
1F
,
0F
,
120
)
button_show_attachment_options
.
fadeInOrOut
(
0F
,
1F
,
120
)
playAnimation
=
true
}
})
button_send
.
setOnClickListener
{
button_send
.
setOnClickListener
{
var
message
=
citation
?:
""
var
message
=
citation
?:
""
...
@@ -277,7 +263,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -277,7 +263,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
sendMessage
(
message
)
sendMessage
(
message
)
}
}
button_show_attachment_options
.
setOnClickListener
{
button_show_attachment_options
.
setOnClickListener
{
if
(
layout_message_attachment_options
.
isShown
)
{
if
(
layout_message_attachment_options
.
isShown
)
{
hideAttachmentOptions
()
hideAttachmentOptions
()
...
@@ -286,7 +271,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -286,7 +271,9 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
}
}
}
}
view_dim
.
setOnClickListener
{
hideAttachmentOptions
()
}
view_dim
.
setOnClickListener
{
hideAttachmentOptions
()
}
button_files
.
setOnClickListener
{
button_files
.
setOnClickListener
{
handler
.
postDelayed
({
handler
.
postDelayed
({
...
@@ -307,6 +294,24 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
...
@@ -307,6 +294,24 @@ class ChatRoomFragment : Fragment(), ChatRoomView {
})
})
}
}
private
fun
subscribeTextMessage
()
{
var
playAnimation
=
true
text_message
.
asObservable
(
0
)
.
subscribe
({
t
->
if
(
t
.
isNotEmpty
()
&&
playAnimation
)
{
button_show_attachment_options
.
fadeInOrOut
(
1F
,
0F
,
120
)
button_send
.
fadeInOrOut
(
0F
,
1F
,
120
)
playAnimation
=
false
}
if
(
t
.
isEmpty
())
{
button_send
.
fadeInOrOut
(
1F
,
0F
,
120
)
button_show_attachment_options
.
fadeInOrOut
(
0F
,
1F
,
120
)
playAnimation
=
true
}
})
}
private
fun
showAttachmentOptions
()
{
private
fun
showAttachmentOptions
()
{
view_dim
.
setVisible
(
true
)
view_dim
.
setVisible
(
true
)
...
...
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