Use M3 theme

This commit is contained in:
smdyv 2022-02-19 15:02:25 +01:00 committed by Daniel Micay
parent 6468f5012f
commit 8453e2f2c6
4 changed files with 13 additions and 11 deletions

View File

@ -6,14 +6,15 @@ import android.os.Bundle;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.grapheneos.pdfviewer.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.grapheneos.pdfviewer.R;
public class DocumentPropertiesFragment extends DialogFragment { public class DocumentPropertiesFragment extends DialogFragment {
public static final String TAG = "DocumentPropertiesFragment"; public static final String TAG = "DocumentPropertiesFragment";
@ -44,7 +45,7 @@ public class DocumentPropertiesFragment extends DialogFragment {
@Override @Override
public Dialog onCreateDialog(Bundle savedInstanceState) { public Dialog onCreateDialog(Bundle savedInstanceState) {
final Activity activity = requireActivity(); final Activity activity = requireActivity();
final AlertDialog.Builder dialog = new AlertDialog.Builder(activity) final MaterialAlertDialogBuilder dialog = new MaterialAlertDialogBuilder(activity)
.setPositiveButton(android.R.string.ok, null); .setPositiveButton(android.R.string.ok, null);
if (mDocumentProperties != null) { if (mDocumentProperties != null) {

View File

@ -7,9 +7,10 @@ import android.widget.FrameLayout;
import android.widget.NumberPicker; import android.widget.NumberPicker;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment; import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.grapheneos.pdfviewer.PdfViewer; import org.grapheneos.pdfviewer.PdfViewer;
public class JumpToPageFragment extends DialogFragment { public class JumpToPageFragment extends DialogFragment {
@ -45,7 +46,7 @@ public class JumpToPageFragment extends DialogFragment {
FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT,
Gravity.CENTER)); Gravity.CENTER));
return new AlertDialog.Builder(requireActivity()) return new MaterialAlertDialogBuilder(requireActivity())
.setView(layout) .setView(layout)
.setPositiveButton(android.R.string.ok, (dialogInterface, i) -> { .setPositiveButton(android.R.string.ok, (dialogInterface, i) -> {
mPicker.clearFocus(); mPicker.clearFocus();

View File

@ -1,12 +1,12 @@
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">#DEFFFFFF</item> <item name="colorPrimary">#DEFFFFFF</item>
<item name="android:statusBarColor">#212121</item> <item name="android:statusBarColor">#212121</item>
</style> </style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.Material3.Dark" />
</resources> </resources>

View File

@ -1,14 +1,14 @@
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <style name="AppTheme" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">#000000</item> <item name="colorPrimary">#000000</item>
<item name="android:statusBarColor">#212121</item> <item name="android:statusBarColor">#212121</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.Material3.Dark" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.Material3.Light" />
</resources> </resources>