Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ protected void onDraw(Canvas canvas) {
// Each card is laid out a little to the right of the previous one.
myPaint.setColor(Color.RED / (i + 1));
myPaint.setStrokeWidth(10);
if (i != N-1) {
canvas.clipRect(MARGIN + i * shift, MARGIN, SIZE + i * shift, SIZE);
}
canvas.drawRect(MARGIN + i * shift, MARGIN, SIZE + i * shift, SIZE, myPaint);
}
// Invalidate the whole view. Doing this calls onDraw() if the view is visible.
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/backgrounds_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/backgrounds_title"
android:background="@android:color/white"/>
/>

<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/backgrounds_list"
android:background="@android:color/white"/>
/>

</LinearLayout>
36 changes: 15 additions & 21 deletions app/src/main/res/layout/hierarchy_layout.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<!-- Version 1. Uses nested LinearLayouts -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:orientation="horizontal">
android:layout_height="wrap_content">

<ImageView
android:id="@+id/chat_author_avatar1"
android:layout_width="@dimen/avatar_dimen"
android:layout_height="@dimen/avatar_dimen"
android:layout_margin="@dimen/avatar_layout_margin"
android:src="@mipmap/ic_launcher" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:src="@mipmap/ic_launcher"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
/>

<TextView
android:id="@+id/text_line_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/line1_text" />
android:text="@string/line1_text"
android:layout_toRightOf="@id/chat_author_avatar1"
/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/line2_text" />
</LinearLayout>
</LinearLayout>
android:text="@string/line2_text"
android:layout_alignLeft="@id/text_line_top"
android:layout_below="@id/text_line_top"
/>

</LinearLayout>
</RelativeLayout>