Ответ 1
Вы можете использовать RelativeLayout для синего поля, выровнять ImageView в верхнем правом углу, а затем использовать отрицательные поля, чтобы надавить на ограничивающий прямоугольник. Здесь образец, иллюстрирующий общую идею:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="-10dp"
android:layout_marginRight="-10dp"
android:src="@drawable/icon"/>
</RelativeLayout>
EDIT: Я играл с этим немного больше, и вам нужно установить android: clipChildren = "false" для родителя RelativeLayout. Здесь более полная выборка:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".LoginActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false">
<RelativeLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#ff0000"
android:layout_margin="100dp">
<ImageView
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="-25dp"
android:layout_marginTop="-25dp"/>
</RelativeLayout>
</LinearLayout>