Skip to content

Instantly share code, notes, and snippets.

@idanakav
Created May 29, 2015 08:35
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idanakav/3676eeaa2985801f7486 to your computer and use it in GitHub Desktop.
Save idanakav/3676eeaa2985801f7486 to your computer and use it in GitHub Desktop.
Percent library
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.percent.PercentRelativeLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
>
<View
android:id="@+id/top_left"
android:layout_alignParentTop="true"
android:layout_height="0dp"
android:layout_width="0dp"
android:background="#ff44aacc"
app:layout_heightPercent="20%"
app:layout_widthPercent="70%"/>
<View
android:id="@+id/top_right"
android:layout_toRightOf="@+id/top_left"
android:layout_alignParentTop="true"
android:layout_height="0dp"
android:layout_width="0dp"
android:background="#ffe40000"
app:layout_heightPercent="20%"
app:layout_widthPercent="30%"/>
<View
android:id="@+id/bottom"
android:layout_below="@+id/top_left"
android:layout_height="0dp"
android:layout_width="match_parent"
android:background="#ff00ff22"
app:layout_heightPercent="80%"/>
</android.support.percent.PercentRelativeLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment