Skip to content

Commit 8fb7bcb

Browse files
committed
refactor(crashlytics): replace RelativeLayout with ConstraintLayout
1 parent e047981 commit 8fb7bcb

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

crash/app/src/main/res/layout/activity_main.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the
1010
specific language governing permissions and limitations under the License.
1111
-->
1212

13-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
13+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
14+
xmlns:app="http://schemas.android.com/apk/res-auto"
1415
xmlns:tools="http://schemas.android.com/tools"
1516
android:layout_width="match_parent"
1617
android:layout_height="match_parent"
@@ -24,25 +25,28 @@ specific language governing permissions and limitations under the License.
2425
android:id="@+id/icon"
2526
android:layout_width="wrap_content"
2627
android:layout_height="wrap_content"
27-
android:layout_centerHorizontal="true"
28-
android:layout_marginBottom="16dp"
29-
android:src="@drawable/firebase_lockup_400" />
28+
android:src="@drawable/firebase_lockup_400"
29+
app:layout_constraintEnd_toEndOf="parent"
30+
app:layout_constraintStart_toStartOf="parent"
31+
app:layout_constraintTop_toTopOf="parent" />
3032

3133
<Button
3234
android:id="@+id/crashButton"
3335
android:layout_width="wrap_content"
3436
android:layout_height="wrap_content"
35-
android:layout_below="@+id/icon"
36-
android:layout_centerHorizontal="true"
37-
android:text="@string/crash_button_label" />
37+
android:text="@string/crash_button_label"
38+
android:layout_marginTop="16dp"
39+
app:layout_constraintEnd_toEndOf="@+id/icon"
40+
app:layout_constraintStart_toStartOf="@+id/icon"
41+
app:layout_constraintTop_toBottomOf="@+id/icon" />
3842

3943
<CheckBox
4044
android:id="@+id/catchCrashCheckBox"
4145
android:layout_width="wrap_content"
4246
android:layout_height="wrap_content"
43-
android:layout_alignRight="@+id/crashButton"
44-
android:layout_alignLeft="@+id/crashButton"
45-
android:layout_below="@+id/crashButton"
47+
android:text="@string/catch_crash_checkbox_label"
4648
android:layout_marginTop="10dp"
47-
android:text="@string/catch_crash_checkbox_label" />
48-
</RelativeLayout>
49+
app:layout_constraintEnd_toEndOf="@+id/crashButton"
50+
app:layout_constraintStart_toStartOf="@+id/crashButton"
51+
app:layout_constraintTop_toBottomOf="@+id/crashButton" />
52+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)