Skip to content

Instantly share code, notes, and snippets.

@makorowy
Created March 2, 2019 13:21
Show Gist options
  • Save makorowy/a8095e6f8f61e59be9a96a8318461515 to your computer and use it in GitHub Desktop.
Save makorowy/a8095e6f8f61e59be9a96a8318461515 to your computer and use it in GitHub Desktop.
Sample for article needs - How to create a compound view?
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:parentTag="android.widget.LinearLayout"
tools:orientation="vertical"
tools:gravity="center">
<TextView
android:id="@+id/consentsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/consents_title"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium" />
<View
android:id="@+id/consentsSeparator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="48dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="48dp"
android:background="@color/colorPrimaryDark" />
<CheckBox
android:id="@+id/consent1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/consent_1" />
<CheckBox
android:id="@+id/consent2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/consent_2" />
</merge>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment