From 48bd5d7f1de1c357987d8593f69481a1d83e0d49 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 24 Feb 2017 08:56:31 -0800 Subject: [PATCH] fix posting of dialogfragments from preferences I can't get preference fragments working in my world (mostly because nested PreferenceScreens don't open when clicked on and the workarounds for that are too complex) so next best thing is to fix alerts to work on top of prefs activity. That involves creating a new transparent activity that subclasses XWActivity and has a DelegateBase subclass. Launching an alert is then just a matter of passing DlgState into the new activity via an Intent, at which point everything Just Works. Button clicks are returned via an intent as well. --- .../android/app/src/main/AndroidManifest.xml | 4 + .../org/eehouse/android/xw4/DelegateBase.java | 32 +++++- .../org/eehouse/android/xw4/DlgDelegate.java | 15 ++- .../eehouse/android/xw4/DlgDelegateAlert.java | 24 +++-- .../org/eehouse/android/xw4/HostActivity.java | 36 +++++++ .../org/eehouse/android/xw4/HostDelegate.java | 97 +++++++++++++++++++ .../eehouse/android/xw4/PrefsActivity.java | 9 ++ .../eehouse/android/xw4/PrefsDelegate.java | 27 ++++++ .../org/eehouse/android/xw4/RequestCode.java | 3 + 9 files changed, 230 insertions(+), 17 deletions(-) create mode 100644 xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostActivity.java create mode 100644 xwords4/android/app/src/main/java/org/eehouse/android/xw4/HostDelegate.java diff --git a/xwords4/android/app/src/main/AndroidManifest.xml b/xwords4/android/app/src/main/AndroidManifest.xml index 96c1e4142..f509f3788 100644 --- a/xwords4/android/app/src/main/AndroidManifest.xml +++ b/xwords4/android/app/src/main/AndroidManifest.xml @@ -73,6 +73,10 @@ + +