diff options
| author | Po Lu | 2023-09-23 08:31:45 +0800 |
|---|---|---|
| committer | Po Lu | 2023-09-23 08:31:45 +0800 |
| commit | d2f024af612d5951c7572725d4054ca732154576 (patch) | |
| tree | 542959b4fdf5d9b98ef16a66054735b2fd1c1317 /java/org | |
| parent | d1d444c2b789a90da584227ae314f29d79131848 (diff) | |
| download | emacs-d2f024af612d5951c7572725d4054ca732154576.tar.gz emacs-d2f024af612d5951c7572725d4054ca732154576.zip | |
Display background dialogs using the correct style
* java/org/gnu/emacs/EmacsDialog.java (toAlertDialog): Wrap
CONTEXT within EmacsStyle such that dialogs are displayed in the
same style used by activities.
Diffstat (limited to 'java/org')
| -rw-r--r-- | java/org/gnu/emacs/EmacsDialog.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/org/gnu/emacs/EmacsDialog.java b/java/org/gnu/emacs/EmacsDialog.java index af3bf538410..bad1ddde227 100644 --- a/java/org/gnu/emacs/EmacsDialog.java +++ b/java/org/gnu/emacs/EmacsDialog.java | |||
| @@ -41,6 +41,7 @@ import android.widget.Button; | |||
| 41 | import android.widget.LinearLayout; | 41 | import android.widget.LinearLayout; |
| 42 | import android.widget.FrameLayout; | 42 | import android.widget.FrameLayout; |
| 43 | 43 | ||
| 44 | import android.view.ContextThemeWrapper; | ||
| 44 | import android.view.View; | 45 | import android.view.View; |
| 45 | import android.view.ViewGroup; | 46 | import android.view.ViewGroup; |
| 46 | import android.view.Window; | 47 | import android.view.Window; |
| @@ -158,6 +159,13 @@ public final class EmacsDialog implements DialogInterface.OnDismissListener | |||
| 158 | TypedArray attributes; | 159 | TypedArray attributes; |
| 159 | Window window; | 160 | Window window; |
| 160 | 161 | ||
| 162 | /* Wrap the context within a style wrapper. Any dialog properties | ||
| 163 | tied to EmacsStyle (such as those applied by the system ``dark | ||
| 164 | theme'') will thus affect the dialog irrespective of whether | ||
| 165 | CONTEXT is an activity or the service. */ | ||
| 166 | |||
| 167 | context = new ContextThemeWrapper (context, R.style.EmacsStyle); | ||
| 168 | |||
| 161 | size = buttons.size (); | 169 | size = buttons.size (); |
| 162 | styleId = -1; | 170 | styleId = -1; |
| 163 | 171 | ||