Optimized conversation rendering.

This commit is contained in:
Pierre 2018-03-17 16:49:50 +01:00
parent 23714bdd89
commit 5c6a38b49c
2 changed files with 9 additions and 2 deletions

View File

@ -122,9 +122,14 @@ public class ConversationMessageAdapter extends ArrayAdapter<ConversationMessage
.findViewById(R.id.fragment_conversation_message_item_left_account_image)
.setVisibility(View.GONE);
//Align text on the right
contentView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_END);
}
else {
//Message appears on the right
((LinearLayout)convertView).setGravity(Gravity.START);
@ -142,6 +147,8 @@ public class ConversationMessageAdapter extends ArrayAdapter<ConversationMessage
.findViewById(R.id.fragment_conversation_message_item_right_account_image)
.setVisibility(View.GONE);
//Align text on the left
contentView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);
}
/*

View File

@ -17,7 +17,7 @@
<LinearLayout
android:id="@+id/fragment_conversation_message_item_container"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp"
@ -40,7 +40,7 @@
android:layout_gravity="center"
android:padding="5dp"
android:textColor="@color/conversation_otheruser_messages_textColor"
tools:text="A message" />
tools:text="A message"/>
<ImageView
android:id="@+id/fragment_conversation_message_item_messageimage"