Update Android port

* java/AndroidManifest.xml.in: Specify @style/EmacsStyle.
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Stop setting
the theme here.
* java/res/values-v11/style.xml:
* java/res/values-v14/style.xml:
* java/res/values-v29/style.xml:
* java/res/values/style.xml: Extract style resources into
res/values.
This commit is contained in:
Po Lu 2023-03-01 14:31:57 +08:00
parent 15bcb446be
commit 194b3f948c
6 changed files with 103 additions and 8 deletions

View file

@ -67,7 +67,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
android:icon="@drawable/emacs"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@android:style/Theme"
android:theme="@style/EmacsStyle"
android:debuggable="@ANDROID_DEBUGGABLE@"
android:extractNativeLibs="true">

View file

@ -187,13 +187,6 @@ public class EmacsActivity extends Activity
= intent.getBooleanExtra ("org.gnu.emacs.START_DASH_Q",
false);
/* Set the theme to one without a title bar. */
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
setTheme (android.R.style.Theme_DeviceDefault_NoActionBar);
else
setTheme (android.R.style.Theme_NoTitleBar);
params = new FrameLayout.LayoutParams (LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT);

View file

@ -0,0 +1,23 @@
<!-- Style resources for GNU Emacs on Android.
Copyright (C) 2023 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 on Android 3.x. -->
<style name="EmacsStyle" parent="@android:style/Theme.Holo.NoActionBar"/>
</resources>

View file

@ -0,0 +1,24 @@
<!-- Style resources for GNU Emacs on Android.
Copyright (C) 2023 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.0
and Android 10. -->
<style name="EmacsStyle" parent="@android:style/Theme.DeviceDefault.NoActionBar"/>
</resources>

View file

@ -0,0 +1,30 @@
<!-- Style resources for GNU Emacs on Android.
Copyright (C) 2023 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 from Android 10.0
onwards-->
<style name="EmacsStyle" parent="@android:style/Theme.DeviceDefault.DayNight">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<!-- Required to make sure the status bar text remains legible. -->
<item name="android:statusBarColor">@android:color/black</item>
</style>
</resources>

25
java/res/values/style.xml Normal file
View file

@ -0,0 +1,25 @@
<!-- Style resources for GNU Emacs on Android.
Copyright (C) 2023 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 on Android 2.2 and
2.3. Styles used for newer Android versions are defined in
the res/values- directories for their respective API levels. -->
<style name="EmacsStyle" parent="@android:style/Theme.NoTitleBar"/>
</resources>