Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<com.androidmentor.custompercentlayout.PercentLinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_percent_linear_layout"
android:layout_height="match_parent"
android:layout_width="match_parent"
tools:context="com.androidmentor.custompercentlayout.PercentLinearLayoutActivity">
@gatorboy
gatorboy / PercentRelativeLayout.xml
Created February 22, 2017 23:43
PercentRelativeLayout with aspect ratio in %
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_percent_relative_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:background="@android:color/holo_blue_dark"
@gatorboy
gatorboy / PercentRelativeLayout.xml
Created February 22, 2017 23:40
PercentRelativeLayout with margins in %
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_percent_relative_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:background="@android:color/holo_blue_dark"
@gatorboy
gatorboy / PercentRelativeLayout.xml
Created February 22, 2017 23:39
PercentRelativeLayout with width and height in %
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_percent_relative_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:background="@android:color/holo_blue_dark"
@gatorboy
gatorboy / RelativeLayout.xml
Created February 22, 2017 23:35
RelativeLayout using weightSum for aligning views.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_percent_relative_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:background="@android:color/darker_gray"
android:layout_height="wrap_content"
@gatorboy
gatorboy / PercentRelativeLayout.xml
Last active February 22, 2017 23:29
PercentRelativeLayout with layout_widthPercent in %
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_percent_relative_layout"
android:layout_height="match_parent"
android:layout_width="match_parent">
<TextView
android:background="@android:color/holo_blue_dark"