|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| 3 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 4 | + xmlns:tools="http://schemas.android.com/tools" |
| 5 | + android:id="@+id/activity_main" |
| 6 | + android:layout_width="match_parent" |
| 7 | + android:layout_height="match_parent" |
| 8 | + tools:context="com.example.android.constraintlayoutexamples.MainActivity"> |
| 9 | + |
| 10 | + <TextView |
| 11 | + android:id="@+id/textView" |
| 12 | + android:layout_width="0dp" |
| 13 | + android:layout_height="wrap_content" |
| 14 | + android:layout_marginEnd="16dp" |
| 15 | + android:layout_marginStart="16dp" |
| 16 | + android:layout_marginTop="40dp" |
| 17 | + android:text="@string/constraint_layout_example" |
| 18 | + android:textAlignment="center" |
| 19 | + android:textSize="30sp" |
| 20 | + app:layout_constraintLeft_toLeftOf="parent" |
| 21 | + app:layout_constraintRight_toRightOf="parent" |
| 22 | + app:layout_constraintTop_toTopOf="parent" |
| 23 | + tools:layout_constraintLeft_creator="1" |
| 24 | + tools:layout_constraintRight_creator="1" |
| 25 | + tools:layout_constraintTop_creator="1" /> |
| 26 | + |
| 27 | + <Button |
| 28 | + android:id="@+id/button" |
| 29 | + android:layout_width="0dp" |
| 30 | + android:layout_height="wrap_content" |
| 31 | + android:layout_marginBottom="8dp" |
| 32 | + android:layout_marginEnd="16dp" |
| 33 | + android:layout_marginStart="16dp" |
| 34 | + android:onClick="show" |
| 35 | + android:tag="constraint_example_1" |
| 36 | + android:text="Basic Use" |
| 37 | + app:layout_constraintBottom_toTopOf="@+id/button2" |
| 38 | + app:layout_constraintLeft_toLeftOf="parent" |
| 39 | + app:layout_constraintRight_toRightOf="parent" |
| 40 | + tools:layout_constraintBottom_creator="1" |
| 41 | + tools:layout_constraintLeft_creator="1" |
| 42 | + tools:layout_constraintRight_creator="1" /> |
| 43 | + |
| 44 | + <Button |
| 45 | + android:id="@+id/button2" |
| 46 | + android:layout_width="0dp" |
| 47 | + android:layout_height="wrap_content" |
| 48 | + android:layout_marginBottom="12dp" |
| 49 | + android:onClick="show" |
| 50 | + android:tag="constraint_example_2" |
| 51 | + android:text="Basic Arange" |
| 52 | + app:layout_constraintBottom_toTopOf="@+id/button30" |
| 53 | + app:layout_constraintLeft_toLeftOf="@+id/button" |
| 54 | + app:layout_constraintRight_toRightOf="@+id/button" |
| 55 | + tools:layout_constraintBottom_creator="1" |
| 56 | + tools:layout_constraintLeft_creator="1" |
| 57 | + tools:layout_constraintRight_creator="1" /> |
| 58 | + |
| 59 | + <Button |
| 60 | + android:id="@+id/button15" |
| 61 | + android:layout_width="0dp" |
| 62 | + android:layout_height="wrap_content" |
| 63 | + android:layout_marginBottom="16dp" |
| 64 | + android:onClick="show" |
| 65 | + android:tag="constraint_example_4" |
| 66 | + android:text="Advanced Arangement" |
| 67 | + app:layout_constraintBottom_toTopOf="@+id/button18" |
| 68 | + app:layout_constraintLeft_toLeftOf="@+id/button30" |
| 69 | + app:layout_constraintRight_toRightOf="@+id/button30" |
| 70 | + tools:layout_constraintBottom_creator="1" |
| 71 | + tools:layout_constraintLeft_creator="1" |
| 72 | + tools:layout_constraintRight_creator="1" /> |
| 73 | + |
| 74 | + <Button |
| 75 | + android:id="@+id/button18" |
| 76 | + android:layout_width="0dp" |
| 77 | + android:layout_height="wrap_content" |
| 78 | + android:layout_marginBottom="8dp" |
| 79 | + android:onClick="show" |
| 80 | + android:tag="constraint_example_5" |
| 81 | + android:text="Aspect Ratio" |
| 82 | + app:layout_constraintBottom_toTopOf="@+id/button19" |
| 83 | + app:layout_constraintLeft_toLeftOf="@+id/button15" |
| 84 | + app:layout_constraintRight_toRightOf="@+id/button15" |
| 85 | + tools:layout_constraintBottom_creator="1" |
| 86 | + tools:layout_constraintLeft_creator="1" |
| 87 | + tools:layout_constraintRight_creator="1" /> |
| 88 | + |
| 89 | + <Button |
| 90 | + android:id="@+id/button19" |
| 91 | + android:layout_width="0dp" |
| 92 | + android:layout_height="wrap_content" |
| 93 | + android:layout_marginBottom="8dp" |
| 94 | + android:onClick="show" |
| 95 | + android:tag="constraint_example_6" |
| 96 | + android:text="Basic Chains" |
| 97 | + app:layout_constraintBottom_toTopOf="@+id/button20" |
| 98 | + app:layout_constraintLeft_toLeftOf="@+id/button18" |
| 99 | + app:layout_constraintRight_toRightOf="@+id/button18" |
| 100 | + tools:layout_constraintBottom_creator="1" |
| 101 | + tools:layout_constraintLeft_creator="1" |
| 102 | + tools:layout_constraintRight_creator="1" /> |
| 103 | + |
| 104 | + <Button |
| 105 | + android:id="@+id/button20" |
| 106 | + android:layout_width="0dp" |
| 107 | + android:layout_height="wrap_content" |
| 108 | + android:layout_marginBottom="8dp" |
| 109 | + android:onClick="show" |
| 110 | + android:tag="constraint_example_7" |
| 111 | + android:text="ConstraintSet" |
| 112 | + app:layout_constraintBottom_toTopOf="@+id/button21" |
| 113 | + app:layout_constraintLeft_toLeftOf="@+id/button19" |
| 114 | + app:layout_constraintRight_toRightOf="@+id/button19" |
| 115 | + tools:layout_constraintBottom_creator="1" |
| 116 | + tools:layout_constraintLeft_creator="1" |
| 117 | + tools:layout_constraintRight_creator="1" /> |
| 118 | + |
| 119 | + <Button |
| 120 | + android:id="@+id/button21" |
| 121 | + android:layout_width="0dp" |
| 122 | + android:layout_height="wrap_content" |
| 123 | + android:layout_marginBottom="22dp" |
| 124 | + android:onClick="show" |
| 125 | + android:tag="constraint_example_x1" |
| 126 | + android:text="Advanced Chains" |
| 127 | + app:layout_constraintBottom_toBottomOf="parent" |
| 128 | + app:layout_constraintLeft_toLeftOf="@+id/button20" |
| 129 | + app:layout_constraintRight_toRightOf="@+id/button20" |
| 130 | + tools:layout_constraintBottom_creator="1" |
| 131 | + tools:layout_constraintLeft_creator="1" |
| 132 | + tools:layout_constraintRight_creator="1" /> |
| 133 | + |
| 134 | + <Button |
| 135 | + android:id="@+id/button30" |
| 136 | + android:layout_width="0dp" |
| 137 | + android:layout_height="wrap_content" |
| 138 | + android:layout_marginBottom="13dp" |
| 139 | + android:onClick="show" |
| 140 | + android:tag="constraint_example_3" |
| 141 | + android:text="Guidelines" |
| 142 | + app:layout_constraintBottom_toTopOf="@+id/button15" |
| 143 | + app:layout_constraintLeft_toLeftOf="@+id/button2" |
| 144 | + app:layout_constraintRight_toRightOf="@+id/button2" |
| 145 | + tools:layout_constraintBottom_creator="1" |
| 146 | + tools:layout_constraintLeft_creator="1" |
| 147 | + tools:layout_constraintRight_creator="1" /> |
| 148 | +</android.support.constraint.ConstraintLayout> |
0 commit comments