blob: 136329fe78db249daa2a7a2e10b245d53e429d9a [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:orientation="vertical"
tools:ignore="HardcodedText" >
<!-- Vertical Layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- No weight: Always an error -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Button" />
<Button
android:layout_width="wrap_content"
android:layout_height="0dp"
android:text="Button" />
<!--
0dp not along the orientation axis is wrong;
here layout_height is okay, layout_width is not
-->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Button" />
<!-- OK -->
<Button
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1.0"
android:text="Button" />
</LinearLayout>
<!-- Horizontal Layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<!-- OK -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Button" />
<!-- Not OK -->
<Button
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1.0"
android:text="Button" />
</LinearLayout>
<!-- No orientation specified, so horizontal -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!-- OK -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:text="Button" />
<!-- Not OK -->
<Button
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1.0"
android:text="Button" />
<!-- Check suppressed -->
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Button"
tools:ignore="Suspicious0dp" />
</LinearLayout>
</FrameLayout>