I'm trying to create a view from a Custom List.
See picture below
Colors : - blue is the Layout of the view - pink is a row from the list - red is a picture, size fixed located to the left - grey is a place to display 2 texts : a label and a value - orange is another picture, size fixed, which should be located to the right
I read a lot about layouts, but can't find a way to do this.
Whatever I try, if the text is too long it goes under the orange picture.
Here is the XML I'm using :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/flower_picture"
android:layout_width="80dp"
android:layout_height="80dp"
android:background="@color/white"
android:padding="1dp"
android:scaleType="fitXY" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:orientation="horizontal">
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="LABEL" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:ellipsize="end"
android:maxLines="1" />
</LinearLayout>
<ImageView
android:id="@+id/wateredbutton"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@color/white"
android:scaleType="fitXY" />
</LinearLayout>
I tried many things but can't find a way to limit the size of the text without setting a textSize of a layout_width.
I assumed that android would be able to detect that there are 3 layouts to display in a row, and would be able to limit the middle one to the desired size if needed.
Is there a way to do this ?