mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
Fix styling issues on Android 15 QPR1
* java/org/gnu/emacs/EmacsView.java (EmacsView): Guarantee that frame views are created with the correct theme. * java/res/values-v20/style.xml (EmacsStyle): * java/res/values-v29/style.xml (EmacsStyle): Disable a swiping gesture enabled on certain Android systems. * java/res/values-v35/style.xml: Rename from `styles'.xml.
This commit is contained in:
parent
f372508f68
commit
96d26b4936
4 changed files with 65 additions and 23 deletions
|
|
@ -24,10 +24,11 @@ import android.content.Context;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
|
import android.view.ContextThemeWrapper;
|
||||||
import android.view.DragEvent;
|
import android.view.DragEvent;
|
||||||
import android.view.View;
|
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewTreeObserver;
|
import android.view.ViewTreeObserver;
|
||||||
import android.view.WindowInsets;
|
import android.view.WindowInsets;
|
||||||
|
|
@ -127,32 +128,36 @@ public final class EmacsView extends ViewGroup
|
||||||
public
|
public
|
||||||
EmacsView (EmacsWindow window)
|
EmacsView (EmacsWindow window)
|
||||||
{
|
{
|
||||||
super (EmacsService.SERVICE);
|
/* This is required to guarantee that popup menus respect the
|
||||||
|
default style. */
|
||||||
|
super (new ContextThemeWrapper (EmacsService.SERVICE,
|
||||||
|
R.style.EmacsStyle));
|
||||||
|
{
|
||||||
|
Object tem;
|
||||||
|
Context context;
|
||||||
|
|
||||||
Object tem;
|
this.window = window;
|
||||||
Context context;
|
this.damageRegion = new Region ();
|
||||||
|
|
||||||
this.window = window;
|
setFocusable (true);
|
||||||
this.damageRegion = new Region ();
|
setFocusableInTouchMode (true);
|
||||||
|
|
||||||
setFocusable (true);
|
/* Create the surface view. */
|
||||||
setFocusableInTouchMode (true);
|
this.surfaceView = new EmacsSurfaceView (this);
|
||||||
|
addView (this.surfaceView);
|
||||||
|
|
||||||
/* Create the surface view. */
|
/* Get rid of the default focus highlight. */
|
||||||
this.surfaceView = new EmacsSurfaceView (this);
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
|
||||||
addView (this.surfaceView);
|
setDefaultFocusHighlightEnabled (false);
|
||||||
|
|
||||||
/* Get rid of the default focus highlight. */
|
/* Obtain the input method manager. */
|
||||||
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O)
|
context = getContext ();
|
||||||
setDefaultFocusHighlightEnabled (false);
|
tem = context.getSystemService (Context.INPUT_METHOD_SERVICE);
|
||||||
|
imManager = (InputMethodManager) tem;
|
||||||
|
|
||||||
/* Obtain the input method manager. */
|
/* Add this view as its own global layout listener. */
|
||||||
context = getContext ();
|
getViewTreeObserver ().addOnGlobalLayoutListener (this);
|
||||||
tem = context.getSystemService (Context.INPUT_METHOD_SERVICE);
|
}
|
||||||
imManager = (InputMethodManager) tem;
|
|
||||||
|
|
||||||
/* Add this view as its own global layout listener. */
|
|
||||||
getViewTreeObserver ().addOnGlobalLayoutListener (this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void
|
private void
|
||||||
|
|
|
||||||
30
java/res/values-v20/style.xml
Normal file
30
java/res/values-v20/style.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
<!-- Style resources for GNU Emacs on Android.
|
||||||
|
|
||||||
|
Copyright (C) 2025 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
This file is part of GNU Emacs.
|
||||||
|
|
||||||
|
GNU Emacs is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
GNU Emacs is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<!-- Style used for popup menus and relatives between Android 4.4 W
|
||||||
|
and Android 10. -->
|
||||||
|
<style name="EmacsStyle"
|
||||||
|
parent="@android:style/Theme.DeviceDefault.NoActionBar">
|
||||||
|
<!-- Suppress the swipe-to-dismiss gesture enabled on certain
|
||||||
|
systems. -->
|
||||||
|
<item name="android:windowSwipeToDismiss">false</item>
|
||||||
|
</style>
|
||||||
|
<style name="EmacsStyleOpen" parent="@android:style/Theme.DeviceDefault"/>
|
||||||
|
</resources>
|
||||||
|
|
@ -18,14 +18,18 @@ You should have received a copy of the GNU General Public License
|
||||||
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
|
along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<!-- Style used for popup menus and relatives from Android 10.0
|
<!-- Style used for popup menus and relatives from Android 10.0 to
|
||||||
onwards-->
|
14.0. -->
|
||||||
<style name="EmacsStyle" parent="@android:style/Theme.DeviceDefault.DayNight">
|
<style name="EmacsStyle" parent="@android:style/Theme.DeviceDefault.DayNight">
|
||||||
<item name="android:windowActionBar">false</item>
|
<item name="android:windowActionBar">false</item>
|
||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
|
||||||
<!-- Required to make sure the status bar text remains legible. -->
|
<!-- Required to make sure the status bar text remains legible. -->
|
||||||
<item name="android:statusBarColor">@android:color/black</item>
|
<item name="android:statusBarColor">@android:color/black</item>
|
||||||
|
|
||||||
|
<!-- Suppress the swipe-to-dismiss gesture enabled on certain
|
||||||
|
systems. -->
|
||||||
|
<item name="android:windowSwipeToDismiss">false</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="EmacsStyleOpen"
|
<style name="EmacsStyleOpen"
|
||||||
parent="@android:style/Theme.DeviceDefault.DayNight"/>
|
parent="@android:style/Theme.DeviceDefault.DayNight"/>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,9 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
|
||||||
<item name="android:windowActionBar">false</item>
|
<item name="android:windowActionBar">false</item>
|
||||||
<item name="android:windowNoTitle">true</item>
|
<item name="android:windowNoTitle">true</item>
|
||||||
<item name="android:windowLightStatusBar">?android:attr/isLightTheme</item>
|
<item name="android:windowLightStatusBar">?android:attr/isLightTheme</item>
|
||||||
|
<!-- Suppress the swipe-to-dismiss gesture enabled on certain
|
||||||
|
systems. -->
|
||||||
|
<item name="android:windowSwipeToDismiss">false</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="EmacsStyleOpen"
|
<style name="EmacsStyleOpen"
|
||||||
parent="@android:style/Theme.DeviceDefault.DayNight"/>
|
parent="@android:style/Theme.DeviceDefault.DayNight"/>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue