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) .findViewById(R.id.fragment_conversation_message_item_left_account_image)
.setVisibility(View.GONE); .setVisibility(View.GONE);
//Align text on the right
contentView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_END);
} }
else { else {
//Message appears on the right //Message appears on the right
((LinearLayout)convertView).setGravity(Gravity.START); ((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) .findViewById(R.id.fragment_conversation_message_item_right_account_image)
.setVisibility(View.GONE); .setVisibility(View.GONE);
//Align text on the left
contentView.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_START);
} }
/* /*

View File

@ -17,7 +17,7 @@
<LinearLayout <LinearLayout
android:id="@+id/fragment_conversation_message_item_container" android:id="@+id/fragment_conversation_message_item_container"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="5dp" android:padding="5dp"