From 8453e2f2c6007d33dc257e937e9e42c9a85b4094 Mon Sep 17 00:00:00 2001 From: smdyv <88971341+smdyv@users.noreply.github.com> Date: Sat, 19 Feb 2022 15:02:25 +0100 Subject: [PATCH] Use M3 theme --- .../pdfviewer/fragment/DocumentPropertiesFragment.java | 9 +++++---- .../pdfviewer/fragment/JumpToPageFragment.java | 5 +++-- app/src/main/res/values-night/styles.xml | 4 ++-- app/src/main/res/values/styles.xml | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/org/grapheneos/pdfviewer/fragment/DocumentPropertiesFragment.java b/app/src/main/java/org/grapheneos/pdfviewer/fragment/DocumentPropertiesFragment.java index a287065..851d9d5 100644 --- a/app/src/main/java/org/grapheneos/pdfviewer/fragment/DocumentPropertiesFragment.java +++ b/app/src/main/java/org/grapheneos/pdfviewer/fragment/DocumentPropertiesFragment.java @@ -6,14 +6,15 @@ import android.os.Bundle; import android.widget.ArrayAdapter; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + +import org.grapheneos.pdfviewer.R; + import java.util.ArrayList; import java.util.List; -import org.grapheneos.pdfviewer.R; - public class DocumentPropertiesFragment extends DialogFragment { public static final String TAG = "DocumentPropertiesFragment"; @@ -44,7 +45,7 @@ public class DocumentPropertiesFragment extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { final Activity activity = requireActivity(); - final AlertDialog.Builder dialog = new AlertDialog.Builder(activity) + final MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(activity) .setPositiveButton(android.R.string.ok, null); if (mDocumentProperties != null) { diff --git a/app/src/main/java/org/grapheneos/pdfviewer/fragment/JumpToPageFragment.java b/app/src/main/java/org/grapheneos/pdfviewer/fragment/JumpToPageFragment.java index c907acf..5441b15 100644 --- a/app/src/main/java/org/grapheneos/pdfviewer/fragment/JumpToPageFragment.java +++ b/app/src/main/java/org/grapheneos/pdfviewer/fragment/JumpToPageFragment.java @@ -7,9 +7,10 @@ import android.widget.FrameLayout; import android.widget.NumberPicker; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import org.grapheneos.pdfviewer.PdfViewer; public class JumpToPageFragment extends DialogFragment { @@ -45,7 +46,7 @@ public class JumpToPageFragment extends DialogFragment { FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER)); - return new AlertDialog.Builder(requireActivity()) + return new MaterialAlertDialogBuilder(requireActivity()) .setView(layout) .setPositiveButton(android.R.string.ok, (dialogInterface, i) -> { mPicker.clearFocus(); diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index f96de1a..3743572 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -1,12 +1,12 @@ - - -