I have a layout in which I have 7 images, which are one of the elements of the list. I want to create this view without any static heights and widths. I want to create it in such a way that it works for any permission. Images are downloaded from the server.
Below is a view

Below is a quote that I am using. But I do not want to assign static height and width, such as 65dp and all .. plzz help me
<ImageView
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp"
android:id="@+id/mainimg"
android:layout_width="147dp"
android:layout_height="137dp"
android:src="@drawable/thumb" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="144dp"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="72dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/img1"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb" />
<ImageView android:layout_marginLeft="5dp"
android:id="@+id/img2"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb" />
<ImageView android:layout_marginLeft="5dp"
android:id="@+id/img3"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="72dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/img4"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb" />
<ImageView
android:id="@+id/img5"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb"
android:layout_marginLeft="5dp"/>
<ImageView
android:layout_marginLeft="5dp"
android:id="@+id/img6"
android:layout_width="65dp"
android:layout_height="69dp"
android:src="@drawable/thumb" />
</LinearLayout>
</LinearLayout>
source
share