HomeTaskerTasker Smart NavBar #7 Smarter NavBar

Tasker Smart NavBar #7 Smarter NavBar

All NavBar Actions but smarter

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:

  1. short term actions (ie. display clipboard)
  2. contextual actions (ie. open app like Facebook, WhatsApp)
  3. timed or persistent actions (ie. play music)
  4. location based actions (ie. alarms at home)
  5. other actions (ie. USB plugged in)
  6. 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.

Manual override

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]
TASKER TASK: SNB Manual override1
SNB Manual Override1 
	
	A1: Variable Clear [ Name:%SNBorder1 Pattern Matching:Off Local Variables Only:Off ] 
	A2: Perform Task [ Name:SNB Clear NavBar Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]

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.

TASKER TASK: SNB Clear NavBar
SNB Clear NavBar
	
	A1: Perform Task [ Name:%SNBorder1 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder1 Set ]
	
	A2: Perform Task [ Name:%SNBorder2 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder2 Set ]
	
	A3: Perform Task [ Name:%SNBorder3 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder3 Set ]
	
	A4: Perform Task [ Name:%SNBorder4 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder4 Set ]
	
	A5: Perform Task [ Name:%SNBorder5 Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder5 Set ]
	
	A6: Perform Task [ Name:%SNBorder6 Priority:%priority Parameter 1 (%par1 Set 1): 
Parameter 2 (%par2): Return Value Variable: Stop:On ] 
	If [ %SNBorder6 Set ]

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.

Exceptions

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

Conclusion

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. As usual, if you have any questions you can drop it in this Reddit thread.

Project Download

Download project files here. Bear in mind that Patreon supporters have early access to project files and videos.

PayPal

Nothing says "Thank you" better than keeping my coffee jar topped up!

Patreon

Support me on Patreon and get an early access to tutorial files and videos.

image/svg+xml

Bitcoin (BTC)

Use this QR to keep me caffeinated with BTC: 1FwFqqh71mUTENcRe9q4s9AWFgoc8BA9ZU

New to Tasker?

Tasker Quick Start – Getting started with Tasker

0
From newb to not so newbie in 10 min

Best Tasker Projects

How to use Raspberry PI as WOL (wake on lan) server

0
While you could wake up your PC from a mobile directly, having a dedicated server capable of doing so is the best solution. The reason is simple. You can hook up as many devices as you wish with a single endpoint. This is why Raspberry Pi is perfect for this.

How to wake on LAN computers and put it to sleep with Power Menu,...

0
How to Wake on LAN properly via Android, Alexa, Google Assistant and Web

7 awesome Bluetooth keyboard shortcuts for Android

0
7 unique Android shortcuts that you can add to any Bluetooth keyboard.

Smart overnight charging with Tasker

0
Still keeping your phone plugged in overnight? Try smarter overnight charging with this profile

One thing that Join app can’t do and how to fix it with Tasker

0
It's not possible to share the clipboard automatically between join accounts registered to 2 different emails. But you can fix this with tasker.

Essential Guides

Tasker: Seconds into DD:HH:MM:SS (dynamic)

0
It's time to.... ok it's a pun, but I will show you how to master time and convert seconds to DD:HH:MM:SS dynamically

4 ways to organise Tasker projects

0
Keep your Tasker tidy!

A better way to store Tasker credentials

0
The more clever way of managing credentials

Annoyed with dozens of AutoApps populating your app drawer? Here is a fix!

0
Clear your app drawer from the clutter in seconds

Putting AutoTools pie chart to a good use – SSID logger

0
Who wants a piece of the pie (chart)?