aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorPo Lu2025-03-04 09:36:19 +0800
committerPo Lu2025-03-04 09:47:30 +0800
commitd6aea7cc948f13615237a91d347b0383a3089a8a (patch)
treef7481b625b4eb14784042f82e0a67aa71df1a483 /java
parentec517d1dcf3260b2cf1684566b5e3bf3979eaceb (diff)
downloademacs-d6aea7cc948f13615237a91d347b0383a3089a8a.tar.gz
emacs-d6aea7cc948f13615237a91d347b0383a3089a8a.zip
Circumvent another styling issue in Android 15 QPR1
* java/org/gnu/emacs/EmacsView.java (popupMenu): On Android 15 and later, reload the default theme before displaying popup menus.
Diffstat (limited to 'java')
-rw-r--r--java/org/gnu/emacs/EmacsView.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java
index 938e2a21d1a..8f16dbad257 100644
--- a/java/org/gnu/emacs/EmacsView.java
+++ b/java/org/gnu/emacs/EmacsView.java
@@ -707,6 +707,8 @@ public final class EmacsView extends ViewGroup
707 popupMenu (EmacsContextMenu menu, int xPosition, 707 popupMenu (EmacsContextMenu menu, int xPosition,
708 int yPosition, boolean force) 708 int yPosition, boolean force)
709 { 709 {
710 ContextThemeWrapper context;
711
710 if (popupActive && !force) 712 if (popupActive && !force)
711 return false; 713 return false;
712 714
@@ -720,6 +722,16 @@ public final class EmacsView extends ViewGroup
720 contextMenu = menu; 722 contextMenu = menu;
721 popupActive = true; 723 popupActive = true;
722 724
725 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM)
726 {
727 context = (ContextThemeWrapper) getContext ();
728 /* It is necessary to reload the current theme before attempting
729 to display a new popup menu, or any previously applied system
730 theme will continue to apply to it. */
731 context.setTheme (R.style.EmacsStyleOpen);
732 context.setTheme (R.style.EmacsStyle);
733 }
734
723 /* Use showContextMenu (float, float) on N to get actual popup 735 /* Use showContextMenu (float, float) on N to get actual popup
724 behavior. */ 736 behavior. */
725 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) 737 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)