Page 1 of 1

Closing recent() apps

Posted: 16 Nov 2019 11:53
by Lucy
Heya. I tried using the control ui script that someone put in the forum to clear my recents but it executes the script as it should until the "click" part. It then just nags and hangs there with the script still active but unable to stop. What am i doing wrong? I thought maybe the button label but i changed that and still not completing.

The script i downloaded:
//////////////////////////////////

recents();
while (NOT existsElementById("com.android.systemui:id/recents_container"))
{
sleep(10);
}
while (existsElementById("com.android.systemui:id/app_thumbnail"))
{
longclickById("com.android.systemui:id/app_thumbnail");
while (NOT existsElementById("android:id/title"))
{
sleep(10);
}
click("CLOSE ALL");
clicked = click("CLOSE ALL");
if(not clicked)
{
home();
}}

(The last 6 lines is my slight modification)
My recents() clear button:
//////////////////////////////////
Screenshot_20191116-223856.jpg

Re: Closing recent() apps

Posted: 16 Nov 2019 11:55
by Lucy
Sorry. Attachment didnt work.
Here is my recent() here
Screenshot_20191116-223856.jpg
Screenshot_20191116-223856.jpg (337.27 KiB) Viewed 9639 times

Re: Closing recent() apps

Posted: 16 Nov 2019 12:58
by Lucy
Lol i tried a lot of variations and yes i used the overlay in control ui to determine what is available. This is my final attempt. I just cant doit😭

//////////////////////////SCRIPT/////////////////////////////


recents();
while (NOT existsElementById("com.android.systemui:id/recents_container"))
{
sleep(10);
}
while (existsElementById("com.android.systemui:id/app_thumbnail"))
{
longclickById("com.android.systemui:id/app_thumbnail");
while (NOT existsElementById("android:id/title"))
{
sleep(10);
}
value = existsElementById("com.android.systemui:id/recents_close_all_button");
sleep(10);
focus("CLOSE ALL");
sleep(10);
focus(540, 1839);
sleep(10);
click(540, 1839);
sleep(10);
click("CLOSE ALL");
sleep(10);
clickById("com.android.systemui:id/recents_close_all_button");
bounds = getBoundsById("com.android.systemui:id/dismiss_task");
sleep(10);
bounds = getBoundsByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
clickById("com.android.systemui:id/dismiss_task");
sleep(10);
clickByIdAndIndex("com.android.systemui:id/dismiss_task", 1);
sleep(10);
scrollForwardById("com.android.systemui:id/dismiss_task");
scrollForward(934, 1376);
scrollBackward("Close appname");
scrollBackward(540, 1101);
focus("Close appname");
click("Close appnsme");
clicked = click("Close appname");
if(not clicked)
{
back();
}}

Re: Closing recent() apps

Posted: 16 Nov 2019 15:19
by Lucy
Ok so aftet a lot of messing around. I have finaly got the script to do the job... all is good🤙

Re: Closing recent() apps

Posted: 22 Nov 2019 17:30
by Desmanto
CLOSE ALL is the nuke button you have there. It is strongly advised not to do this. I have that kind of nuke button too, but I don't event want to touch it. In my previous MIUI ROM, that button will kill Automagic Accessibility services. The Acc service seems to be enabled, but actually have been slayed and can't perform any UI related action anymore.

Jsut leave all your recent app alone. Android nowadays is smart enought to manage the RAM usage. Only at some certain special cases that you need to kill manually. And that doesn't even require kill all. It is better to reboot to refresh all service at once.

Re: Closing recent() apps

Posted: 22 Nov 2019 21:18
by Lucy
Thanks darlin