Commit cadc0ed5 authored by Lucio Maciel's avatar Lucio Maciel

Fix spacing on messages and messages streaming

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