Skip to content

Commit e8743a6

Browse files
authored
refactor(app-indexing): replace RelativeLayout with ConstraintLayout (#1230)
1 parent 7641eff commit e8743a6

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,70 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
3-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
44
android:layout_width="fill_parent"
55
android:layout_height="fill_parent"
66
android:background="#fff2f2f2"
7-
android:paddingLeft="16dp"
8-
android:paddingTop="16dp"
9-
android:paddingRight="16dp"
10-
android:paddingBottom="16dp">
7+
android:padding="16dp">
118

129
<ImageView
1310
android:id="@+id/icon"
1411
android:layout_width="wrap_content"
1512
android:layout_height="wrap_content"
16-
android:layout_centerHorizontal="true"
17-
android:src="@drawable/firebase_lockup_400" />
13+
android:src="@drawable/firebase_lockup_400"
14+
app:layout_constraintEnd_toEndOf="parent"
15+
app:layout_constraintStart_toStartOf="parent"
16+
app:layout_constraintTop_toTopOf="parent" />
1817

1918
<TextView
2019
android:id="@+id/contentIndexLabel"
2120
style="@style/TextAppearance.AppCompat.Medium"
2221
android:layout_width="wrap_content"
2322
android:layout_height="wrap_content"
24-
android:layout_below="@+id/icon"
25-
android:layout_alignParentStart="true"
26-
android:text="@string/content_label" />
23+
android:text="@string/content_label"
24+
app:layout_constraintStart_toStartOf="parent"
25+
app:layout_constraintTop_toBottomOf="@+id/icon" />
2726

2827
<TextView
2928
android:id="@+id/textView"
3029
android:layout_width="wrap_content"
3130
android:layout_height="wrap_content"
32-
android:layout_below="@+id/contentIndexLabel"
33-
android:layout_alignParentStart="true"
34-
android:text="@string/link_label" />
31+
android:text="@string/link_label"
32+
app:layout_constraintStart_toStartOf="@+id/contentIndexLabel"
33+
app:layout_constraintTop_toBottomOf="@+id/contentIndexLabel" />
3534

3635
<TextView
3736
android:id="@+id/link"
3837
android:layout_width="wrap_content"
3938
android:layout_height="wrap_content"
40-
android:layout_below="@+id/contentIndexLabel"
41-
android:layout_toEndOf="@+id/textView"
42-
android:text="@string/none" />
39+
android:text="@string/none"
40+
app:layout_constraintBottom_toBottomOf="@+id/textView"
41+
app:layout_constraintStart_toEndOf="@+id/textView"
42+
app:layout_constraintTop_toTopOf="@+id/textView"/>
4343

4444
<TextView
4545
android:id="@+id/stickerIndexLabel"
4646
style="@style/TextAppearance.AppCompat.Medium"
4747
android:layout_width="wrap_content"
4848
android:layout_height="wrap_content"
49-
android:layout_below="@+id/textView"
50-
android:layout_alignParentStart="true"
49+
android:text="@string/stickers_label"
5150
android:layout_marginTop="20dp"
52-
android:text="@string/stickers_label" />
51+
app:layout_constraintStart_toStartOf="parent"
52+
app:layout_constraintTop_toBottomOf="@+id/textView" />
5353

5454
<Button
5555
android:id="@+id/addStickersBtn"
5656
android:layout_width="wrap_content"
5757
android:layout_height="wrap_content"
58-
android:layout_below="@+id/stickerIndexLabel"
59-
android:layout_alignEnd="@+id/clearStickersBtn"
60-
android:layout_alignParentStart="true"
61-
android:text="Add Stickers" />
58+
android:text="Add Stickers"
59+
app:layout_constraintStart_toStartOf="parent"
60+
app:layout_constraintTop_toBottomOf="@+id/stickerIndexLabel" />
6261

6362
<Button
6463
android:id="@+id/clearStickersBtn"
6564
android:layout_width="wrap_content"
6665
android:layout_height="wrap_content"
67-
android:layout_below="@+id/addStickersBtn"
68-
android:layout_alignParentStart="true"
69-
android:text="Clear Stickers" />
66+
android:text="Clear Stickers"
67+
app:layout_constraintStart_toStartOf="parent"
68+
app:layout_constraintTop_toBottomOf="@+id/addStickersBtn" />
7069

71-
</RelativeLayout>
70+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)