To utilize the functionality of Mobile Status & Navigation Bar in your code, include the following line:
using SaariTech.UI;
You have two options for accessing the component:
1. Accessing the component statically: You can directly access the component from the current activated GameObject and its methods without adding the object to your code. For example:
// Execute the code statically
StatusNavigation.Show();
2. Using the component as a reference: Instantiate an object of the component class and access its methods and properties. For example:
// Get the component
MobileStatusNavigationBar mobileStatusNavigationBar = GetComponent<MobileStatusNavigationBar>();
// Execute the code dynamically
mobileStatusNavigationBar.Hide();
Here are the C# public functions you can use in both dynamic and static method:
To show and hide the status and navigation bar:
// === Status & Navigation ===
StatusNavigation.Show();
StatusNavigation.Hide();
// === Status ===
StatusBar.Show();
StatusBar.Hide();
// === Navigation ===
NavigationBar.Show();
NavigationBar.Hide();
To set the background color of the status and navigation bars:
// === Status & Navigation ===
StatusNavigation.SetColor(Color color);
// === Status ===
StatusBar.SetColor(Color color);
// === Navigation ===
NavigationBar.SetColor(Color color);
To set the background color to light or dark mode:
// === Status & Navigation ===
StatusNavigation.SetLightMode();
StatusNavigation.SetDarkMode();
// === Status ===
StatusBar.SetLightMode();
StatusBar.SetDarkMode();
// === Navigation ===
NavigationBar.SetLightMode();
NavigationBar.SetDarkMode();
To modify the color of the light and dark mode templates:
// === Status & Navigation ===
StatusNavigation.ChangeLightModeColorTemplate(Color color);
StatusNavigation.ChangeDarkModeColorTemplate(Color color);
// === Status ===
StatusBar.ChangeLightModeColorTemplate(Color color);
StatusBar.ChangeDarkModeColorTemplate(Color color);
// === Navigation ===
NavigationBar.ChangeLightModeColorTemplate(Color color);
NavigationBar.ChangeDarkModeColorTemplate(Color color);
Please note that these methods will update the color template, you still need to run StatusNavigation.SetLightMode(); or StatusNavigation.SetDarkMode(); or other Light & Dark Mode Toggle to apply update the color of the system bars.
Andorid Custom Proguard File:
If you are using Android Proguard (Minify), include this line in Assets/Plugins/Android/proguard-user.txt to keep the Java code of Mobile Status & Navigation bar.
-keep class com.saaritech.uistatusnavigationbar.* { *; }
If you’re seeking more advanced functionalities, you may find the C# Code Part 2 useful. It offers additional resources and information that can further extend your options with the Asset.