Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit 24382f5

Browse files
author
Nagesh Susarla
committed
Add readme
Change-Id: Ia37ef8fb111498e4a335c22868044cfe6a8b1733
1 parent 16d3b9a commit 24382f5

File tree

7 files changed

+60
-5
lines changed

7 files changed

+60
-5
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
Constraint Layout Samples
2+
=========================
3+
This repository contains a list of layouts that showcases the various features and usage of
4+
[ConstraintLayout](https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html)
5+
6+
Pre-requisites
7+
--------------
8+
- Android Studio 2.3 Beta 4
9+
- Constaint Layout library 1.0.0-beta5
10+
11+
Getting Started
12+
---------------
13+
Import the project using Android Studio. Navigate to the app>res>layout> and open one of the layouts
14+
in the layout editor. This sample is best understood by seeing the constraints in the Design mode
15+
of the layout editor.
16+
17+
Screenshots
18+
------------
19+
20+
![Constraint Set Example](screenshots/constraint_set_example.png "Constraint Set Example")
21+
![Advanced Chains Example](screenshots/advanced_chains.png "Advanced usage of Chains")
22+
23+
Support
24+
-------
25+
If you've found an error in this sample, please file an issue.
26+
To learn more about ConstraintLayout checkout the
27+
[Constraint Layout Training Guide](https://developer.android.com/training/constraint-layout/index.html)
28+
Patches are encouraged, and may be submitted by forking this project and
29+
submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
30+
31+
License
32+
-------
33+
34+
Copyright 2017 The Android Open Source Project, Inc.
35+
36+
Licensed to the Apache Software Foundation (ASF) under one or more contributor
37+
license agreements. See the NOTICE file distributed with this work for
38+
additional information regarding copyright ownership. The ASF licenses this
39+
file to you under the Apache License, Version 2.0 (the "License"); you may not
40+
use this file except in compliance with the License. You may obtain a copy of
41+
the License at
42+
43+
http://www.apache.org/licenses/LICENSE-2.0
44+
45+
Unless required by applicable law or agreed to in writing, software
46+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
47+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
48+
License for the specific language governing permissions and limitations under
49+
the License.

app/src/main/res/layout/constraint_example_1.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@
7272
tools:layout_constraintBottom_creator="1"
7373
app:layout_constraintBottom_toBottomOf="@+id/button31"
7474
tools:layout_constraintLeft_creator="1"
75-
app:layout_constraintTop_toTopOf="@+id/button3" />
75+
app:layout_constraintTop_toTopOf="@+id/button3"
76+
app:layout_constraintHorizontal_bias="0.0" />
7677

7778
<Button
7879
android:id="@+id/button33"
@@ -84,7 +85,8 @@
8485
app:layout_constraintBottom_toTopOf="@+id/button32"
8586
app:layout_constraintTop_toTopOf="@+id/button32"
8687
tools:layout_constraintTop_creator="1"
87-
tools:layout_constraintBottom_creator="1" />
88+
tools:layout_constraintBottom_creator="1"
89+
app:layout_constraintHorizontal_bias="0.5" />
8890

8991
<Button
9092
android:id="@+id/button34"
@@ -99,6 +101,7 @@
99101
tools:layout_constraintTop_creator="1"
100102
tools:layout_constraintBottom_creator="1"
101103
app:layout_constraintBottom_toBottomOf="@+id/button32"
102-
app:layout_constraintTop_toTopOf="@+id/button3" />
104+
app:layout_constraintTop_toTopOf="@+id/button3"
105+
app:layout_constraintHorizontal_bias="0.52" />
103106

104107
</android.support.constraint.ConstraintLayout>

app/src/main/res/layout/constraintset_example_big.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
app:layout_constraintBottom_toBottomOf="parent"
5959
android:layout_marginBottom="16dp"
6060
tools:layout_constraintTop_creator="1"
61-
tools:layout_constraintBottom_creator="1" />
61+
tools:layout_constraintBottom_creator="1"
62+
app:layout_constraintHorizontal_bias="0.0"
63+
app:layout_constraintVertical_bias="0.0" />
6264

6365
</android.support.constraint.ConstraintLayout>

app/src/main/res/layout/constraintset_example_main.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
app:layout_constraintTop_toTopOf="@+id/textView9"
3333
tools:layout_constraintBottom_creator="1"
3434
tools:layout_constraintTop_creator="1"
35-
android:contentDescription="@string/lake_tahoe_image" />
35+
android:contentDescription="@string/lake_tahoe_image"
36+
app:layout_constraintVertical_bias="0.0" />
3637

3738
<TextView
3839
android:id="@+id/textView9"

screenshots/advanced_chains.png

790 KB
Loading

screenshots/constraint_set.png

1000 KB
Loading
1.14 MB
Loading

0 commit comments

Comments
 (0)