Commit cadc0ed5 authored by Lucio Maciel's avatar Lucio Maciel

Fix spacing on messages and messages streaming

parent 44475941
...@@ -12,8 +12,8 @@ android { ...@@ -12,8 +12,8 @@ android {
applicationId "chat.rocket.android" applicationId "chat.rocket.android"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion versions.targetSdk targetSdkVersion versions.targetSdk
versionCode 1003 versionCode 1004
versionName "2.0.0-dev2" versionName "2.0.0-dev3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
} }
......
...@@ -116,6 +116,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView, ...@@ -116,6 +116,10 @@ class ChatRoomPresenter @Inject constructor(private val view: ChatRoomView,
else -> client.connect() else -> client.connect()
} }
launchUI(strategy) {
listenMessages(roomId)
}
// TODO - when we have a proper service, we won't need to take care of connection, just // TODO - when we have a proper service, we won't need to take care of connection, just
// subscribe and listen... // subscribe and listen...
/*launchUI(strategy) { /*launchUI(strategy) {
......
...@@ -66,7 +66,7 @@ class ChatRoomAdapter(private val serverUrl: String) : RecyclerView.Adapter<Chat ...@@ -66,7 +66,7 @@ class ChatRoomAdapter(private val serverUrl: String) : RecyclerView.Adapter<Chat
text_message_time.text = message.time text_message_time.text = message.time
text_content.text = message.content text_content.text = message.content
bindAttachment(message, attachment_container, image_attachment, audio_video_attachment, bindAttachment(message, message_attachment, image_attachment, audio_video_attachment,
file_name) file_name)
} }
...@@ -78,6 +78,7 @@ class ChatRoomAdapter(private val serverUrl: String) : RecyclerView.Adapter<Chat ...@@ -78,6 +78,7 @@ class ChatRoomAdapter(private val serverUrl: String) : RecyclerView.Adapter<Chat
with(message) { with(message) {
if (attachmentUrl == null || attachmentType == null) { if (attachmentUrl == null || attachmentType == null) {
attachment_container.setVisible(false) attachment_container.setVisible(false)
return
} }
var imageVisible = false var imageVisible = false
......
...@@ -13,8 +13,8 @@ fun String.ifEmpty(value: String): String { ...@@ -13,8 +13,8 @@ fun String.ifEmpty(value: String): String {
return this return this
} }
fun View.setVisible(value: Boolean) { fun View.setVisible(visible: Boolean) {
visibility = if (value) { visibility = if (visible) {
View.VISIBLE View.VISIBLE
} else { } else {
View.GONE View.GONE
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="10dp" android:layout_marginBottom="6dp"
android:layout_marginEnd="@dimen/screen_edge_left_and_right_margins" android:layout_marginEnd="@dimen/screen_edge_left_and_right_margins"
android:layout_marginStart="@dimen/screen_edge_left_and_right_margins" android:layout_marginStart="@dimen/screen_edge_left_and_right_margins"
android:layout_marginTop="10dp"> android:layout_marginTop="6dp">
<include <include
android:id="@+id/layout_avatar" android:id="@+id/layout_avatar"
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<!-- TODO - Use separate adapter items for messages and attachments. --> <!-- TODO - Use separate adapter items for messages and attachments. -->
<include <include
android:id="@+id/message_attachment"
layout="@layout/message_attachment" layout="@layout/message_attachment"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment