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
8ea0a6a1
Unverified
Commit
8ea0a6a1
authored
Jun 10, 2018
by
Filipe de Lima Brito
Committed by
GitHub
Jun 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1354 from divyanshub024/no-chat-msg
[IMPROVEMENT] Code optimisation for empty chat view
parents
afe5a739
93c5172b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
22 deletions
+12
-22
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+2
-14
fragment_chat_room.xml
app/src/main/res/layout/fragment_chat_room.xml
+10
-8
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
8ea0a6a1
...
...
@@ -265,7 +265,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
verticalScrollOffset
.
set
(
0
)
}
presenter
.
loadActiveMembers
(
chatRoomId
,
chatRoomType
,
filterSelfOut
=
true
)
toggleNoChatView
(
adapter
.
itemCount
)
empty_chat_view
.
isVisible
=
adapter
.
itemCount
==
0
}
}
...
...
@@ -287,18 +287,6 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
}
private
fun
toggleNoChatView
(
size
:
Int
)
{
if
(
size
==
0
)
{
image_chat_icon
.
setVisible
(
true
)
text_chat_title
.
setVisible
(
true
)
text_chat_description
.
setVisible
(
true
)
}
else
{
image_chat_icon
.
setVisible
(
false
)
text_chat_title
.
setVisible
(
false
)
text_chat_description
.
setVisible
(
false
)
}
}
private
val
layoutChangeListener
=
View
.
OnLayoutChangeListener
{
_
,
_
,
_
,
_
,
bottom
,
_
,
_
,
_
,
oldBottom
->
val
y
=
oldBottom
-
bottom
...
...
@@ -412,7 +400,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
adapter
.
prependData
(
message
)
recycler_view
.
scrollToPosition
(
0
)
verticalScrollOffset
.
set
(
0
)
toggleNoChatView
(
adapter
.
itemCount
)
empty_chat_view
.
isVisible
=
adapter
.
itemCount
==
0
}
}
...
...
app/src/main/res/layout/fragment_chat_room.xml
View file @
8ea0a6a1
...
...
@@ -30,13 +30,11 @@
android:layout_height=
"100dp"
android:src=
"@drawable/ic_chat_black_24dp"
android:tint=
"@color/icon_grey"
android:visibility=
"gone"
app:layout_constraintBottom_toTopOf=
"@id/text_chat_title"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_chainStyle=
"packed"
tools:visibility=
"visible"
/>
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/text_chat_title"
...
...
@@ -47,12 +45,10 @@
android:textColor=
"@color/colorSecondaryText"
android:textSize=
"20sp"
android:textStyle=
"bold"
android:visibility=
"gone"
app:layout_constraintBottom_toTopOf=
"@id/text_chat_description"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_chat_icon"
tools:visibility=
"visible"
/>
app:layout_constraintTop_toBottomOf=
"@id/image_chat_icon"
/>
<TextView
android:id=
"@+id/text_chat_description"
...
...
@@ -63,11 +59,17 @@
android:textAlignment=
"center"
android:textColor=
"@color/colorSecondaryTextLight"
android:textSize=
"16sp"
android:visibility=
"gone"
app:layout_constraintBottom_toTopOf=
"@id/layout_message_composer"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_title"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_title"
/>
<android.support.constraint.Group
android:id=
"@+id/empty_chat_view"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:constraint_referenced_ids=
"image_chat_icon, text_chat_title, text_chat_description"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<chat.rocket.android.widget.autocompletion.ui.SuggestionsView
...
...
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