Page 1 of 1

Keep focus on proper screen with Control UI

Posted: 16 Jun 2019 15:11
by Econdoc
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

Posted: 16 Jun 2019 17:10
by Desmanto
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.

Re: Keep focus on proper screen with Control UI

Posted: 16 Jun 2019 18:56
by Econdoc
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.

Re: Keep focus on proper screen with Control UI

Posted: 17 Jun 2019 16:57
by Desmanto
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.