From eace68a325b96d12188ea8d673f30bad1354b916 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 18 Sep 2024 10:08:26 +0800 Subject: [PATCH] Fix layout of preferences activity on Android 35 * java/org/gnu/emacs/EmacsPreferencesActivity.java (onCreate): Align list view to system windows. --- java/org/gnu/emacs/EmacsPreferencesActivity.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/java/org/gnu/emacs/EmacsPreferencesActivity.java b/java/org/gnu/emacs/EmacsPreferencesActivity.java index a3edd6388b4..128d0b22658 100644 --- a/java/org/gnu/emacs/EmacsPreferencesActivity.java +++ b/java/org/gnu/emacs/EmacsPreferencesActivity.java @@ -28,6 +28,8 @@ import android.os.Bundle; import android.os.Build; +import android.view.View; + import android.widget.Toast; import android.preference.*; @@ -115,6 +117,7 @@ public class EmacsPreferencesActivity extends PreferenceActivity { Preference tem; Preference.OnPreferenceClickListener listener; + View view; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) setTheme (android.R.style.Theme_DeviceDefault_Settings); @@ -167,5 +170,13 @@ else if (Build.VERSION.SDK_INT }; tem.setOnPreferenceClickListener (listener); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM) + { + /* Align the list view to system windows, or they will be + obstructed by the title bar. */ + view = this.getListView (); + view.setFitsSystemWindows (true); + } } };