diff --git a/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatMyImageMessage.java b/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatMyImageMessage.java index 8438b0117a53158fde9613a2f7b0e92fb0755289..ec65eaef09b8c6953cc8a277726a4900f6c7d632 100644 --- a/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatMyImageMessage.java +++ b/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatMyImageMessage.java @@ -14,8 +14,6 @@ import com.ninja.mobile.communicator.data.models.mqtt.Desc; import com.ninja.mobile.communicator.data.models.mqtt.Message; import com.ninja.mobile.communicator.intetfaces.OnItemClickListener; -import java.util.Date; - import butterknife.BindView; public class ChatMyImageMessage extends BaseChatVh { @@ -34,8 +32,7 @@ public class ChatMyImageMessage extends BaseChatVh { @Override public void setData(Message item) { Desc desc = item.files.get(item.files.size() - 1); Glide.with(getContext()).load(desc.payload).into(mImage); - String time = - new Date(item.created == null ? System.currentTimeMillis() : item.created).toString(); - mTime.setText(time); + long time = item.created == null ? System.currentTimeMillis() : item.created; + mTime.setText(getTime(time)); } } diff --git a/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatOtherImageMessageVh.java b/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatOtherImageMessageVh.java index d0eea2a5e8c9f4b512a15abd3a739ee1cd292a8f..8f7d097bbbfe1f16604e2252a0efda571e2afaf4 100644 --- a/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatOtherImageMessageVh.java +++ b/app/src/main/java/com/ninja/mobile/communicator/ui/adapters/viewholders/ChatOtherImageMessageVh.java @@ -14,8 +14,6 @@ import com.ninja.mobile.communicator.data.models.mqtt.Desc; import com.ninja.mobile.communicator.data.models.mqtt.Message; import com.ninja.mobile.communicator.intetfaces.OnItemClickListener; -import java.util.Date; - import butterknife.BindView; public class ChatOtherImageMessageVh extends BaseChatVh { @@ -34,8 +32,7 @@ public class ChatOtherImageMessageVh extends BaseChatVh { @Override public void setData(Message item) { Desc desc = item.files.get(item.files.size() - 1); Glide.with(getContext()).load(desc.payload).into(mImage); - String time = - new Date(item.created == null ? System.currentTimeMillis() : item.created).toString(); - mTime.setText(time); + long time = item.created == null ? System.currentTimeMillis() : item.created; + mTime.setText(getTime(time)); } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_chat.xml b/app/src/main/res/layout/fragment_chat.xml index 712abbd4d985dc0673fcbf36479ede44b375ccac..112dccf84846d430f0ca71702fe2234200bebe96 100644 --- a/app/src/main/res/layout/fragment_chat.xml +++ b/app/src/main/res/layout/fragment_chat.xml @@ -10,7 +10,7 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - tools:listitem="@layout/li_chat_other_message" /> + tools:listitem="@layout/li_chat_my_image_message" /> - - - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="right" + android:orientation="horizontal"> - - \ No newline at end of file + android:background="@drawable/grey_chat_bubble" + android:paddingBottom="4dp" + android:paddingEnd="4dp" + android:paddingStart="4dp" + android:paddingTop="4dp" + app:layout_constraintRight_toRightOf="parent" + android:layout_marginEnd="24dp"> + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/li_chat_other_image_message.xml b/app/src/main/res/layout/li_chat_other_image_message.xml index 03c3fe68778745301836e3e58ae4bac1a52e38f3..5904a56daef06af4b7c663bbb45c9c26c00840d5 100644 --- a/app/src/main/res/layout/li_chat_other_image_message.xml +++ b/app/src/main/res/layout/li_chat_other_image_message.xml @@ -1,28 +1,33 @@ + android:layout_marginStart="64dp" + android:background="@drawable/white_chat_bubble" + android:paddingBottom="4dp" + android:paddingEnd="4dp" + android:paddingStart="4dp" + android:paddingTop="4dp"> + android:layout_height="wrap_content" + android:adjustViewBounds="true" + android:maxHeight="@dimen/chat.img.max" + android:maxWidth="@dimen/chat.img.max" + android:scaleType="centerInside" + tools:src="@drawable/actions" /> + android:textSize="8dp" + tools:text="11:20 am" /> \ No newline at end of file diff --git a/app/src/main/res/values/dimen.xml b/app/src/main/res/values/dimen.xml index bf8980838fd30c42281251024310e27dc4ef99ec..459d2549256058ef3e6b6c56f22fe9870cd1fc71 100644 --- a/app/src/main/res/values/dimen.xml +++ b/app/src/main/res/values/dimen.xml @@ -9,4 +9,6 @@ 60dp + + 240dp \ No newline at end of file