Keep focus on proper screen with Control UI
Moderator: Martin
Keep focus on proper screen with Control UI
I am trying to use Control UI with quickSettings or with Launch App to change a setting. Generally, this works okay as a stand alone flow. However, when other flows are triggered and run in the background, the focus on quickSettiings or on the window opened in Launch App is lost. How can I keep the focus long enough to click on the icon or slide bar?
Re: Keep focus on proper screen with Control UI
You can use the focus() function variant to focus on the quicksetting menu first. And if it is possible, try to test the function that don't require focus, but still work with your slide bar.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Keep focus on proper screen with Control UI
Thanks for the help. focus() does not seem to work. I tried focus() for an element of quickSettings() that I did not want to change. [focus() does not even exist for the setting that I want to toggle (NFC).]
This tactic had some success: Before opening quickSettings(), issue a home(). I don't know why this works or if is is reliable.
I tried a similar thing by issuing home() in Control UI before starting Launch App. That seemed to work too, although I don't know if I can rely on it to continue working. I was hoping there was some way of stopping other flows from interfering until my Control UI was complete.
This tactic had some success: Before opening quickSettings(), issue a home(). I don't know why this works or if is is reliable.
I tried a similar thing by issuing home() in Control UI before starting Launch App. That seemed to work too, although I don't know if I can rely on it to continue working. I was hoping there was some way of stopping other flows from interfering until my Control UI was complete.
Re: Keep focus on proper screen with Control UI
I never actually encounter the event where my control UI is broken because of other flows triggered. Is it always the same flow that interefere with the Control UI? If yes, then you can simply add a condition at the intefering flow, check if the Control UI flow is executing. If yes, loop sleep 5 seconds and check back again later before continuing to the main branch.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.