Skip to content

Commit 7242047

Browse files
authored
refactor(config): replace RelativeLayout with ConstraintLayout (#1232)
1 parent e8743a6 commit 7242047

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
1+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:app="http://schemas.android.com/apk/res-auto"
23
xmlns:tools="http://schemas.android.com/tools"
34
android:layout_width="match_parent"
45
android:layout_height="match_parent"
@@ -12,24 +13,30 @@
1213
android:id="@+id/icon"
1314
android:layout_width="wrap_content"
1415
android:layout_height="wrap_content"
15-
android:layout_centerHorizontal="true"
16-
android:layout_marginBottom="16dp"
17-
android:src="@drawable/firebase_lockup_400" />
16+
android:src="@drawable/firebase_lockup_400"
17+
app:layout_constraintEnd_toEndOf="parent"
18+
app:layout_constraintStart_toStartOf="parent"
19+
app:layout_constraintTop_toTopOf="parent" />
1820

1921
<TextView
2022
android:id="@+id/welcomeTextView"
2123
android:layout_width="wrap_content"
2224
android:layout_height="wrap_content"
2325
android:layout_below="@+id/icon"
24-
android:layout_centerHorizontal="true"
25-
android:text="Welcome..." />
26+
android:layout_marginTop="16dp"
27+
android:text="Welcome..."
28+
app:layout_constraintEnd_toEndOf="@+id/icon"
29+
app:layout_constraintStart_toStartOf="@+id/icon"
30+
app:layout_constraintTop_toBottomOf="@+id/icon" />
2631

2732
<Button
33+
android:id="@+id/fetchButton"
2834
android:layout_width="wrap_content"
2935
android:layout_height="wrap_content"
3036
android:text="@string/fetch_remote_welcome_message"
31-
android:id="@+id/fetchButton"
32-
android:layout_centerVertical="true"
33-
android:layout_centerHorizontal="true" />
37+
app:layout_constraintBottom_toBottomOf="parent"
38+
app:layout_constraintEnd_toEndOf="parent"
39+
app:layout_constraintStart_toStartOf="parent"
40+
app:layout_constraintTop_toBottomOf="@+id/welcomeTextView" />
3441

35-
</RelativeLayout>
42+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)