Skip to content

Commit

Permalink
fix: use material theme for dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Xtr126 committed Feb 26, 2024
1 parent cde8c7b commit c6c51ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/xtr/keymapper/editor/EditorActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public void onCreate(Bundle savedInstanceState) {
Log.e("editorActivity", e.getMessage(), e);
}
else {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(new ContextThemeWrapper(this, R.style.Theme_XtMapper));
Context dialogContext = new ContextThemeWrapper(this, R.style.Theme_XtMapper);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(dialogContext);

builder.setMessage(R.string.dialog_alert_editor)
.setPositiveButton(R.string.ok, (dialog, which) -> {})
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/xtr/keymapper/editor/EditorUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.view.WindowManager;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.view.ContextThemeWrapper;

import com.google.android.material.dialog.MaterialAlertDialogBuilder;

Expand Down Expand Up @@ -197,7 +198,8 @@ else if (id == R.id.save) {
}
else if (id == R.id.dpad) {
final CharSequence[] items = { "Arrow Keys", "WASD Keys"};
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
Context dialogContext = new ContextThemeWrapper(context, R.style.Theme_XtMapper);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(dialogContext);
builder.setTitle("Select Dpad").setItems(items, (dialog, i) -> {
if (i == 0) addArrowKeysDpad(defaultX, defaultY);
else addWasdDpad(defaultX, defaultY);
Expand Down

0 comments on commit c6c51ed

Please sign in to comment.