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
13a7e81b
Commit
13a7e81b
authored
Apr 24, 2018
by
Divyanshu Bhargava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Empty view for chat messages
parent
46eff2d8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
92 additions
and
10 deletions
+92
-10
ChatRoomFragment.kt
.../java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
+14
-0
ic_chat_black_24dp.xml
app/src/main/res/drawable/ic_chat_black_24dp.xml
+9
-0
fragment_chat_room.xml
app/src/main/res/layout/fragment_chat_room.xml
+63
-10
strings.xml
app/src/main/res/values-hi-rIN/strings.xml
+2
-0
strings.xml
app/src/main/res/values-pt-rBR/strings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/chatroom/ui/ChatRoomFragment.kt
View file @
13a7e81b
...
...
@@ -224,6 +224,19 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
verticalScrollOffset
.
set
(
0
)
}
presenter
.
loadActiveMembers
(
chatRoomId
,
chatRoomType
,
filterSelfOut
=
true
)
toggleNoChatView
(
dataSet
.
size
)
}
}
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
)
}
}
...
...
@@ -308,6 +321,7 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiKeyboardListener, EmojiR
adapter
.
prependData
(
message
)
recycler_view
.
scrollToPosition
(
0
)
verticalScrollOffset
.
set
(
0
)
toggleNoChatView
(
message
.
size
)
}
}
...
...
app/src/main/res/drawable/ic_chat_black_24dp.xml
0 → 100644
View file @
13a7e81b
<vector
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:width=
"24dp"
android:height=
"24dp"
android:viewportWidth=
"24.0"
android:viewportHeight=
"24.0"
>
<path
android:fillColor=
"#FF000000"
android:pathData=
"M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM6,9h12v2L6,11L6,9zM14,14L6,14v-2h8v2zM18,8L6,8L6,6h12v2z"
/>
</vector>
app/src/main/res/layout/fragment_chat_room.xml
View file @
13a7e81b
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/root_layout"
...
...
@@ -11,7 +12,10 @@
android:id=
"@+id/view_loading"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
android:visibility=
"gone"
app:indicatorColor=
"@color/black"
app:indicatorName=
"BallPulseIndicator"
...
...
@@ -19,9 +23,12 @@
<FrameLayout
android:id=
"@+id/message_list_container"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_above=
"@+id/layout_message_composer"
>
android:layout_width=
"0dp"
android:layout_height=
"0dp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toTopOf=
"@id/layout_message_composer"
>
<include
android:id=
"@+id/layout_message_list"
...
...
@@ -35,7 +42,7 @@
android:id=
"@+id/suggestions_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
a
ndroid:layout_above=
"@+
id/layout_message_composer"
a
pp:layout_constraintBottom_toTopOf=
"@
id/layout_message_composer"
android:background=
"@color/suggestion_background_color"
/>
<include
...
...
@@ -43,13 +50,13 @@
layout=
"@layout/message_composer"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
a
ndroid:layout_alignParentBottom=
"true"
/>
a
pp:layout_constraintBottom_toBottomOf=
"parent"
/>
<View
android:id=
"@+id/view_dim"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
a
ndroid:layout_above=
"@+
id/layout_message_composer"
a
pp:layout_constraintBottom_toTopOf=
"@
id/layout_message_composer"
android:background=
"@color/colorDim"
android:visibility=
"gone"
/>
...
...
@@ -58,7 +65,7 @@
layout=
"@layout/message_attachment_options"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
a
ndroid:layout_above=
"@+
id/layout_message_composer"
a
pp:layout_constraintBottom_toTopOf=
"@
id/layout_message_composer"
android:layout_margin=
"5dp"
android:visibility=
"gone"
/>
...
...
@@ -77,4 +84,50 @@
tools:text=
"connected"
tools:visibility=
"visible"
/>
</RelativeLayout>
<ImageView
android:id=
"@+id/image_chat_icon"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:src=
"@drawable/ic_chat_black_24dp"
android:tint=
"#AFADAF"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toTopOf=
"@id/text_chat_title"
app:layout_constraintVertical_chainStyle=
"packed"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/text_chat_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/msg_no_chat_title"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/image_chat_icon"
app:layout_constraintBottom_toTopOf=
"@id/text_chat_description"
android:textSize=
"20sp"
android:layout_marginTop=
"24dp"
android:textStyle=
"bold"
android:textColor=
"#8B8B8B"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/text_chat_description"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/msg_no_chat_description"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/text_chat_title"
app:layout_constraintBottom_toBottomOf=
"parent"
android:layout_marginTop=
"16dp"
android:textAlignment=
"center"
android:textSize=
"16sp"
android:textColor=
"#c1c1c1"
android:visibility=
"gone"
tools:visibility=
"visible"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values-hi-rIN/strings.xml
View file @
13a7e81b
...
...
@@ -89,6 +89,8 @@
</string>
<string
name=
"msg_version"
>
वर्शन
</string>
<string
name=
"msg_build"
>
बिल्ड
</string>
<string
name=
"msg_no_chat_title"
>
कोई चैट संदेश नहीं
</string>
<string
name=
"msg_no_chat_description"
>
यहां अपने संदेश देखने के लिए\nबातचीत शुरू करें।
</string>
<!-- System messages -->
<string
name=
"message_room_name_changed"
>
%2$s ने रूम का नाम बदलकर %1$s किया
</string>
...
...
app/src/main/res/values-pt-rBR/strings.xml
View file @
13a7e81b
...
...
@@ -89,6 +89,8 @@
<string
name=
"msg_ver_not_minimum"
>
Parece que a versão do seu servidor está abaixo da mínima requerida %1$s.\nPor favor, atualize seus servidores antes de continuar!
</string>
<string
name=
"msg_no_chat_title"
>
Nenhuma mensagem de chat
</string>
<string
name=
"msg_no_chat_description"
>
Comece a conversar para ver suas\nmensagens aqui.
</string>
<!-- System messages -->
<string
name=
"message_room_name_changed"
>
Nome da sala alterado para: %1$s por %2$s
</string>
...
...
app/src/main/res/values/strings.xml
View file @
13a7e81b
...
...
@@ -90,6 +90,8 @@
<string
name=
"msg_ver_not_minimum"
>
Looks like your server version is below the minimum required version %1$s.\nPlease upgrade your server to login!
</string>
<string
name=
"msg_no_chat_title"
>
No chat messages
</string>
<string
name=
"msg_no_chat_description"
>
Start conversing to see your\nmessages here.
</string>
<!-- System messages -->
<string
name=
"message_room_name_changed"
>
Room name changed to: %1$s by %2$s
</string>
...
...
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