Please enter your text to search.

Contextual Homescreens with Tasker

[G+] Contextual Homescreens with #Tasker

A few of you have requested that I share more of a step-by-step guide for using Tasker to build a set of contextual homescreens in Android similar to what I described in this post (http://ift.tt/1i3sYYN).

First of all, be sure you’re using a launcher that supports Tasker’s “Go Home” action. I use Nova Launcher. If you use some other launcher, your mileage may vary. 

You may also have to experiment a bit to figure out which page numbers in Tasker correspond to which home screens in your launcher. In the case of Nova Launcher, the first home screen is index zero, but Tasker only sends the request when the page number is greater than zero. That means that I cannot use Tasker to display the first home screen in my launcher.

One of the easiest contexts to handle is probably screen orientation, so let’s focus on that.

The first thing to do is create two home screens in your launcher of choice, one for portrait and one for landscape. Keep in mind that if you’re using Nova Launcher, neither of these can be your first home screen. For purposes of this post, we will assume that we want to display Nova Launcher’s second home screen (index 1) in portrait and the third home screen (index 2) in landscape.

Once you have your two home screens ready to go and know what their indices are, it’s time to fire up Tasker…

– Create a new profile based on State->Display->Display Orientation. The default trigger is “Is Portrait” and that’s fine.
– After you create the profile, Tasker will prompt you to select an entry task for it. Choose “New Task”.
– In the task editor, add an action App->Go Home. The new action will default to Page 0, change that to Page 1.
– Back out to Tasker’s profile list and long-tap your newly created entry task. You should see a contextual menu. Choose “Add Exit Task”.
– You will be prompted to select a task. Choose “New Task”.
– In the task editor, add an action App->Go Home. For this task you want to change the value to Page 2.

That’s it. Exit Tasker and start flipping your device around to see if it worked.

This should be considered a starting point and something to build on. This basic setup has some pitfalls that you’ll find quickly. For instance, if you change screen orientation while inside an app, Tasker will close the app and take you to the appropriate homescreen. That’s probably not a desired behavior. Tasker doesn’t have a built in concept of “is there an app active right now?”, but you can still work around the situation easily. What I did was add an Application based profile and use it to set a variable that keeps track of whether or not the launcher is running. Then I added a condition to both my orientation tasks so that they only change home screens if that variable has a certain value indicating that the launcher is active.

via [G+] http://ift.tt/1f2bWZN