Another option would be to create a custom LinearLayout
that contains your four ImageViews
in xml and could dynamically reorganize how many ImageViews
are shown using weights.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="100dp"
android:layout_height="100dp">
<LinearLayout
android:id="@+id/left_container"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="50dp"
android:layout_height="100dp"
android:orientation="vertical">
<ImageView
android:id="@+id/top_left_image"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#111" />
<ImageView
android:id="@+id/bottom_left_image"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#333" />
</LinearLayout>
<LinearLayout
android:id="@+id/right_container"
android:layout_width="50dp"
android:layout_height="100dp"
android:layout_toRightOf="@+id/left_container"
android:orientation="vertical">
<ImageView
android:id="@+id/top_right_image"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#555" />
<ImageView
android:id="@+id/bottom_right_image"
android:layout_width="50dp"
android:layout_height="0dp"
android:layout_weight="0"
android:background="#777" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent_circle_image"/>
</RelativeLayout>
You mentioned that you were loading the images from urls so if you used this approach you would be able to use a library like Picasso to load the images and you wouldn't have to worry about waiting for all images to download before drawing the rounded image. If you did this each image could be loaded independently of the others.
The only downside would be that you would have to use a image with a transparent circle background to create the appearance of a circular image. You could just create a regular drawable to use. Or you could try drawing it onto a canvas. This questions has a good solution that will create a custom view that draws a transparent circle.
If you want to use the custom view just replace
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent_circle_image"/>
with
<com.app.view.TransparentCircle
android:layout_width="match_parent"
android:layout_height="match_parent"/>