I try to draw a canvas on the left of 2 textviews, this is an adapter in a list. However, now each element in the list has the height of the entire display... but it should be as small as possible (wrap_content). How to proceed?
I really want a FrameLayout, because I want to paint on top of the text. Maybe the ImageView and TextViews should be in a single FrameLayout with gravity?
Here is the code:
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<ImageView
android:id="@+id/tree_item"
android:layout_width="15dp"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:layout_alignTop="@+id/item_name_quantity"
android:layout_alignBottom="@+id/item_price"/>
<LinearLayout
android:layout_width="fill_parent"
android:id="@+id/text_heights"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/item_name_quantity"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:paddingRight="1dp"
android:paddingLeft="2dp"
android:textSize="18sp"
android:textColor="@color/COLOUR_ITEM_TEXT"
android:text="2x special menu"/>
<TextView
android:id="@+id/item_price"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="2dp"
android:gravity="right"
android:text="15,75"
android:textColor="@color/COLOUR_ITEM_TEXT"
android:textSize="12sp"/>
</LinearLayout>
</FrameLayout>