Skip to content

Commit 16f88cf

Browse files
BrayanDSOmikehardy
authored andcommitted
refactor: replace ConstraintLayouts of template previewer
same rationale of the previous commit
1 parent 2db62d7 commit 16f88cf

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout
2+
<LinearLayout
33
xmlns:android="http://schemas.android.com/apk/res/android"
44
xmlns:app="http://schemas.android.com/apk/res-auto"
55
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
6+
android:layout_height="match_parent"
7+
android:orientation="vertical">
78

89
<com.google.android.material.card.MaterialCardView
910
android:id="@+id/webview_container"
1011
android:layout_width="match_parent"
11-
android:layout_marginHorizontal="8dp"
12+
android:layout_marginHorizontal="@dimen/reviewer_side_margin"
1213
android:layout_height="0dp"
13-
app:layout_constraintTop_toTopOf="parent"
14-
app:layout_constraintBottom_toTopOf="@id/show_answer"
1514
style="@style/CardView.ViewerStyle"
15+
android:layout_weight="1"
1616
>
1717

1818
<WebView
@@ -25,13 +25,10 @@
2525

2626
<com.google.android.material.button.MaterialButton
2727
android:id="@+id/show_answer"
28-
android:layout_width="0dp"
28+
android:layout_width="match_parent"
2929
android:layout_height="wrap_content"
3030
style="@style/Widget.Material3.Button.TextButton"
31-
app:layout_constraintStart_toStartOf="parent"
32-
app:layout_constraintEnd_toEndOf="parent"
33-
app:layout_constraintBottom_toBottomOf="parent"
34-
app:layout_constraintTop_toBottomOf="@id/webview_container"
31+
android:layout_marginHorizontal="@dimen/reviewer_side_margin"
3532
android:text="@string/show_answer"/>
3633

37-
</androidx.constraintlayout.widget.ConstraintLayout>
34+
</LinearLayout>

AnkiDroid/src/main/res/layout/template_previewer_container.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@
99
android:background="?attr/alternativeBackgroundColor"
1010
tools:context=".previewer.TemplatePreviewerPage">
1111

12-
<androidx.constraintlayout.widget.ConstraintLayout
12+
<LinearLayout
1313
android:layout_width="match_parent"
14-
android:layout_height="match_parent">
14+
android:layout_height="match_parent"
15+
android:orientation="vertical">
1516

1617
<com.google.android.material.appbar.AppBarLayout
1718
android:id="@+id/appbar"
1819
android:layout_width="match_parent"
19-
android:layout_height="wrap_content"
20-
app:layout_constraintTop_toTopOf="parent">
20+
android:layout_height="wrap_content">
2121

2222
<com.google.android.material.appbar.MaterialToolbar
2323
android:id="@+id/toolbar"
2424
android:layout_width="match_parent"
2525
android:layout_height="wrap_content"
26-
app:layout_constraintTop_toTopOf="parent"
2726
app:navigationContentDescription="@string/abc_action_bar_up_description"
2827
app:navigationIcon="?attr/homeAsUpIndicator"
2928
android:background="?attr/alternativeBackgroundColor">
@@ -45,8 +44,7 @@
4544
android:id="@+id/fragment_container"
4645
android:layout_width="match_parent"
4746
android:layout_height="0dp"
48-
app:layout_constraintTop_toBottomOf="@id/appbar"
49-
app:layout_constraintBottom_toBottomOf="parent" />
50-
</androidx.constraintlayout.widget.ConstraintLayout>
47+
android:layout_weight="1"/>
48+
</LinearLayout>
5149

5250
</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 commit comments

Comments
 (0)