summaryrefslogtreecommitdiff
path: root/java/org/gnu/emacs/EmacsView.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/org/gnu/emacs/EmacsView.java')
-rw-r--r--java/org/gnu/emacs/EmacsView.java47
1 files changed, 26 insertions, 21 deletions
diff --git a/java/org/gnu/emacs/EmacsView.java b/java/org/gnu/emacs/EmacsView.java
index 5abea711506..938e2a21d1a 100644
--- a/java/org/gnu/emacs/EmacsView.java
+++ b/java/org/gnu/emacs/EmacsView.java
@@ -24,10 +24,11 @@ import android.content.Context;
import android.text.InputType;
import android.view.ContextMenu;
+import android.view.ContextThemeWrapper;
import android.view.DragEvent;
-import android.view.View;
import android.view.KeyEvent;
import android.view.MotionEvent;
+import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;
@@ -127,32 +128,36 @@ public final class EmacsView extends ViewGroup
public
EmacsView (EmacsWindow window)
{
- super (EmacsService.SERVICE);
-
- Object tem;
- Context context;
+ /* This is required to guarantee that popup menus respect the
+ default style. */
+ super (new ContextThemeWrapper (EmacsService.SERVICE,
+ R.style.EmacsStyle));
+ {
+ Object tem;
+ Context context;
- this.window = window;
- this.damageRegion = new Region ();
+ this.window = window;
+ this.damageRegion = new Region ();
- setFocusable (true);
- setFocusableInTouchMode (true);
+ setFocusable (true);
+ setFocusableInTouchMode (true);
- /* Create the surface view. */
- this.surfaceView = new EmacsSurfaceView (this);
- addView (this.surfaceView);
+ /* Create the surface view. */
+ this.surfaceView = new EmacsSurfaceView (this);
+ addView (this.surfaceView);
- /* Get rid of the default focus highlight. */
- if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
- setDefaultFocusHighlightEnabled (false);
+ /* Get rid of the default focus highlight. */
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
+ setDefaultFocusHighlightEnabled (false);
- /* Obtain the input method manager. */
- context = getContext ();
- tem = context.getSystemService (Context.INPUT_METHOD_SERVICE);
- imManager = (InputMethodManager) tem;
+ /* Obtain the input method manager. */
+ context = getContext ();
+ tem = context.getSystemService (Context.INPUT_METHOD_SERVICE);
+ imManager = (InputMethodManager) tem;
- /* Add this view as its own global layout listener. */
- getViewTreeObserver ().addOnGlobalLayoutListener (this);
+ /* Add this view as its own global layout listener. */
+ getViewTreeObserver ().addOnGlobalLayoutListener (this);
+ }
}
private void