It’s time to wrap all standalone NavBar actions with a single controller that will enable you to use all NavBar at once (you can pick & mix NavBars)! Up until now, you could only display a single NavBar that would be destroyed once you exit the application or context or a new Smart NavBar would override the old one. This project aims to fix this creating the ultimate Smarter NavBar experience.
Smarter NavBar actions
Let’s say you were listening to music while taking advantage of the Smart NavBar #6 Music Playback controls. Then you decided to open Facebook and enable the Smart NavBar #1 ActivePC which changed the playback control into cast icons (great and intuitive!) but once you left the Facebook, playback controls were nowhere to be found!
Smarter NavBar fixes this by creating an index of importance™ (?) which will decide which NavBar should be displayed next. The index of importance™ can be tailored to your needs and there is a mechanism to override it as well. Here is my proposed index:
- short term actions (ie. display clipboard)
- contextual actions (ie. open app like Facebook, WhatsApp)
- timed or persistent actions (ie. play music)
- location based actions (ie. alarms at home)
- other actions (ie. USB plugged in)
- background actions (ie. login to room)
You can introduce as many levels as you want, the important bit is to have the numeric order of importance with the highest action being the most important. You can assign the importance to your preference, but each standalone Smart NavBar action has to have the index of importance™ assigned.
How do Smarter NavBar actions work
When a NavBar is created, Tasker sends the name of that task to the variable with an appropriate importance level %SNBorder1-6. This keeps track of all NavBar actions that should be relevant at this point.
When the NavBar is destroyed, it is removed from the %SNBorderX (Variable Clear action) and separate task checks if there is another NavBar that should be displayed instead.
There will be rare occasions where the system will fail to display the correct NavBar. This is where a double tap (if not used) can be assigned to manually remove the present NavBar from the list and to display the next one in the order.
Each standalone Smart NavBar action will have to have the double tap task assigned to do so. You can enable this by adding:
=:=SNB Manual Override 1-6 line to the NavBar creation action. (
1-6 is the correct %SNBorder variable to clear)
task(NB Facebook WIFI)[1.0] to task(NB Facebook WIFI=:=SNB Manual Override1)[1.0]
When pressed, the task will kill the current NavBar and restores the next one according to the index of importance™.
SNB Clear NavBar Task
This is the action I want to perform each time when a NavBar is removed. It will check what %SNBorder1-6 variables are set and will apply the one with the biggest importance – this is why it’s important to select STOP in the Perform Task action.
Note that the 6th action has been modified to pass a %par value – explanation in exceptions. Each time this task runs, Tasker is checking if there is another NavBar action it should set.
Smart NavBar #3 NFC actions
To make this standalone project work correctly, in the entry task we have to duplicate the entry IF condition and make it run only IF
%par1 = 1 (Be sure to pass
%par1 = 1 in SNB Manual Override6 and SMB Clear NavBar). This way tasker won’t log you out when running the entry task again:
A11: If [ %par eq 1 ] A12: Variable Set [ Name:%SNBorder6 To:NB Set Room Recurse Variables:Off Do Maths:Off Append:Off ] A13: Perform Task [ Name:NB NFC %NBactiveTag Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] A14: Stop [ With Error:Off Task: ] A15: End If
I also changed the local variable %evtpem2 to %NBactiveTag:
A1: Variable Set [ Name:%NBroomTag To:off ] If [ %NBroomTag !Set ] A2: If [ %NBroomTag ~ on | %NBactiveTag !~R none|%evtprm2 ] A3: Variable Set [ Name:%SNBorder6 To:NB Set Room] A4: Flash [ Text:Logging in please wait Long:Off ] A5: Variable Set [ Name:%NBactiveTag To:%evtprm2 ] If [ %evtprm2 Set ] A6: Perform Task [ Name:NB NFC %NBactiveTag Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ] A7: Flash [ Text:Logged in to %NBactiveTag Long:Off ] A8: Variable Set [ Name:%NBroomTag To:off ] A9: Stop [ With Error:Off Task: ] A10: End If
Once you get the hang of the modifications needed for the Smart NavBar, you will be able to quickly modify all standalone actions to work with this system. Just a side note – the time context in Clipboard is little temperamental. I spoke to Joao about this and he is looking into the time contexts which are short-lived. You can download the project files from this link.