Skip to content

Commit

Permalink
refactor: replace ConstraintLayouts of template previewer
Browse files Browse the repository at this point in the history
same rationale of the previous commit
  • Loading branch information
BrayanDSO committed Dec 23, 2024
1 parent 4e7976d commit 648e8c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
19 changes: 8 additions & 11 deletions AnkiDroid/src/main/res/layout/template_previewer.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">

<com.google.android.material.card.MaterialCardView
android:id="@+id/webview_container"
android:layout_width="match_parent"
android:layout_marginHorizontal="8dp"
android:layout_marginHorizontal="@dimen/reviewer_side_margin"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/show_answer"
style="@style/CardView.ViewerStyle"
android:layout_weight="1"
>

<WebView
Expand All @@ -25,13 +25,10 @@

<com.google.android.material.button.MaterialButton
android:id="@+id/show_answer"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/Widget.Material3.Button.TextButton"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/webview_container"
android:layout_marginHorizontal="@dimen/reviewer_side_margin"
android:text="@string/show_answer"/>

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
14 changes: 6 additions & 8 deletions AnkiDroid/src/main/res/layout/template_previewer_container.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@
android:background="?attr/alternativeBackgroundColor"
tools:context=".previewer.TemplatePreviewerPage">

<androidx.constraintlayout.widget.ConstraintLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
android:layout_height="wrap_content">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:navigationContentDescription="@string/abc_action_bar_up_description"
app:navigationIcon="?attr/homeAsUpIndicator"
android:background="?attr/alternativeBackgroundColor">
Expand All @@ -45,8 +44,7 @@
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/appbar"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
android:layout_weight="1"/>
</LinearLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 comments on commit 648e8c3

Please sign in to comment.