alignment

How to make list view items align left and right programmatically in Android

纵饮孤独 提交于 2020-12-05 12:51:09
问题 I am working on a chat app and on chat view I have to show message left and right. But as I am pretty new in Android programming, I am not being able to achieve this. Here is what I am getting : Here is my chatbubble.xml that is being used to show line items. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bubble_layout_parent" android:layout_width="wrap_content" android:layout_height="wrap_content">

How to make list view items align left and right programmatically in Android

自闭症网瘾萝莉.ら 提交于 2020-12-05 12:51:08
问题 I am working on a chat app and on chat view I have to show message left and right. But as I am pretty new in Android programming, I am not being able to achieve this. Here is what I am getting : Here is my chatbubble.xml that is being used to show line items. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/bubble_layout_parent" android:layout_width="wrap_content" android:layout_height="wrap_content">