Swipe'Em All - Clear your Recent Apps 1.1

Create task which clear Android Recent Apps on the fly

  1. autormali
    Just another Recent Apps cleaner. But super fast :D
    Requirements: Android 7.0+

    It's not recomended to test the task from Tasker during this tutorial. Do it from your screen using the task shortcut.

    /!\ IMORTANT! The description of the steps below has been changed to align with new version of task (v1.1) available for download. Some of the actions has been changed. The videos are not updated to this version.

    STEP 1 - GET VARIABLES FROM AN EMPTY RECENT APPS LIST


    • Create a New Tasker Task.
    • Add AutoInput Global Action.
    • Set Recent Apps in the options.
    • Add Variable Set: %clearall to CLEAR ALL. Edit: Skip this action. This has not been erased from the video.
    • Add AutoInput UI Query action.
    • Set Only Visible in the options.
    • Add three actions Flash: %aitext() , %aitext(#) and %aitext(>) .
    • Add task shortcut to the screen.
    • Go to Recent Apps and clear it.
    • Tap the task shortcut. Get the info from flashes to input them to the next actions.
    Variables in flash actions: %aitext() - an array of queried text, %aitext(#) - total number of elements in an array, %aitext(>) - the first element of an array. Toasted %aitext(#) and %aitext(>) variables values are used in the next step.

    STEP 2 - CREATE IF CONDITION FOR AN EMPTY RECENT APPS LIST


    • Add action If with condition %aitext(#)=1.
    • Communicate that Recent Apps list is empty - Flash variable: %aitext(>).
    • Add AutoInput Global Action.
    • Tap Back option.
    • Add two actions: Else and End If.
    • Grab three earlier created Flash actions and place them between created above Else and End If actions.
    • Go to Recent Apps and clear it.
    • Test the task (tap shortcut).
    You should see an empty Recent App list, receive the toast and return to the screen with the shortcut to the task after the test.

    STEP 3 - SWIPE AND GET VARIABLE


    • After Else action create AutoInput Gestures action.
    • Tap Swipe. For screen resolution 1080x1920 you can use X,Y coordinates given in the video. Set Duration to 25.
    • Edit: Add Wait action - 100 MS. This is not in the video.
    • Add AutoInput UI Query action.
    • Activate Only Visible and Only Clickable options.
    • Go out from Tasker.
    • Have 2-3 apps (but not more) in the Recent Apps.
    • Run the task. Get the info from flashes to input them to the next actions.
    Swipe gesture starts from the top and ends at the bottom of the screen. If you have different screen resolution than mine, you can apply the folowing formula. For screen resolution WxH (WidthxHeight): Start Point: X=W/2,Y=300; Stop Point: X=W/2,Y=H-300. Approximately.

    STEP 4 - CREATE A LOOP


    • Enter Label name: top for AutoInput Gestures action.
    • Add Goto Action Label with condition %aitext(>)!~R%clearall .
      %aitext(>)!~Rcom.android.sytemui:id/button - this change is not in the video.
    • Set Label to top.
    • Disable or throw to the bin created in Step 1 three flash actions.
    • Add Wait action. Set it to 250 MS.
    • Add AutoInput Action .
    • In the options Action set to Click, Type to Text and Field Text to %clearall . Type to Id and Field Text to com.android.sytemui:id/button - this change is not in the video.
    • Add Flash action: Recent items cleared.
    • Go out from Tasker and test the task.
    Action Wait is set at optimum 250 MS value. If you decrease it too much - the next, AutoInput action won't be executed. If you expirience that the task stops after swiping and the recents are not cleared, you should increase the wait time a little bit.
    It's obvious you have to set %clearall variable to your device language. Otherwise it won't work and the task goes into infinite loop.

    STEP 5 - TEST


    Enjoy:)
    joaomgcd likes this.