• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

AutoRotation toggle with toast notification?

Wesku

Lurker
Hello, is it possible to get a toast notification when I toggle autorotation?
I'm using gesture navigation to run tasker task to toggle autorotate and I'd like to get an notification is it turned on or off.

Thanks.
 
Hi there Wesku, and welcome to AF! :ciao:

What you want to do is actually pretty easy. :thumbup:

Go into the task you use to toggle autorotation, and add a new action - Alert > Flash. This is Tasker-speak for "toast". You can enter a bit of static text ("Autorotation Toggled"). Now you'll be toasted each time the Task executes.

If you want to be really fancy, you could use some variable magic to make to toast actually reflect the current status. Let me know if you want help going down that particular rabbit hole. :D
 
Hi there Wesku, and welcome to AF! :ciao:

What you want to do is actually pretty easy. :thumbup:

Go into the task you use to toggle autorotation, and add a new action - Alert > Flash. This is Tasker-speak for "toast". You can enter a bit of static text ("Autorotation Toggled"). Now you'll be toasted each time the Task executes.

If you want to be really fancy, you could use some variable magic to make to toast actually reflect the current status. Let me know if you want help going down that particular rabbit hole. :D
Thanks for help, I'm looking for the fancy way of showing the state of auto-rotation on the toast.

I tried messing around with the variables, but got lost as there wasn't one for auto-rotation.
I'd really appreciate if you could help with them.
 
You'll have to start with a known state (say, Autorotation OFF) and flip-flop the variable around each time.

So add something like this to your task:
• Task > If %RotState ~ off
• Variable > Variable Set %RotState to on
• Task > Else
• Variable > Variable Set %RotState to off
• Task > End If
• Alert > Flash "Autorotate is %RotState"

Note that this will fall apart if you ever change the rotation state without using the Task. I'm not sure any other way to do it though.
 
Now got it to work without breaking, if rotation is toggled without the task! :D
esy7e7yn.jpg
 
Nice solution!

Just working through the logic in my head, if rotation was set to ON by Tasker and you toggled it elsewhere (rotation OFF, but %RotState still "on"), triggering the Task would set the rotation to OFF (so not really accomplishing anything new) but the variable would be updated correctly (and the correct information would be displayed in the toast).

So if they got out of sync, the next time the Task gets triggered no action would actually be taken, but the variables would get set correctly. The next time would return to business as usual.
 
Yeah, it's not perfect but it's better with that one blank action so it won't get out of sync and need to fix it with manually toggling rotation :)
 
Try ...

tlaAutoRotateToggle
A1: If [ %AutoRotate !~ Off/On | %AutoRotate ~ Off ]
A2: Display AutoRotate [ Set:On ]
A3: Variable Set [ Name:%AutoRotate To:On Do Maths:Off Append:Off ]
A4: Else
A5: Display AutoRotate [ Set:Off ]
A6: Variable Set [ Name:%AutoRotate To:Off Do Maths:Off Append:Off ]
A7: End If
A8: Flash [ Text:AutoRotate - %AutoRotate Long:Off ]


... Thom

 
Back
Top Bottom