-
Notifications
You must be signed in to change notification settings - Fork 1
Popups & Preloaders
Android Native provides an API to display native android popups and preloaders.
The Native preloader feature gives you the ability to show nice looking native preloader, in case you need to lock the screen and show preloader to a user while you performing an operation in the background.
When you need to lock the screen, just call the LockScreen method:
using SA.Android.App;
//Show the preloader
AN_Preloader.LockScreen("Please Wait...");
//and hide it in 2 sec
SA_Coroutine.WaitForSeconds(2f, () => {
AN_Preloader.UnlockScreen();
});
With Android Native dialogs you can create object base on AlertDialog android class. There also default themes you may use to make dialogs look better with your app UI:
public enum AN_DialogTheme
{
Default = 0,
Light = 1,
Material = 2,
Material_Light = 3
}
For example, to create a simple message you can use:
var message = new AN_AlertDialog(AN_DialogTheme.Material);
message.Title = "Message";
message.Message = "Some message text";
message.SetPositiveButton("Okay", () => {
AN_Logger.Log("message: ok button was clicked");
});
message.Show();
Or a dialog:
var dialog = new AN_AlertDialog(AN_DialogTheme.Light);
dialog.Title = "Dialog";
dialog.Message = "Some dialog text";
dialog.SetPositiveButton("Yes", () => {
AN_Logger.Log("dialog: Yes button was clicked");
});
dialog.SetNegativeButton("No", () => {
AN_Logger.Log("dialog: No button was clicked");
});
dialog.Show();
You can also create a more complicated Rate Us Dialog for your app
Reliable and high-quality Unity Development service. Let's Talk!
Website | AssetStore | LinkedIn | Youtube | Scripting Reference
- Build Info
- Dark Mode
- Package Info
- Runtime Permissions
- Run External App
- Immersive Mode
- PackageManager
- Popups & Preloaders
- Rate Us Dialog
- Activity
- Intent
- Settings Page
- Media Player
- Date Picker Dialog
- Time Picker Dialog
- Locale
- Wheel Picker Dialog
- Developer Console Setup
- Connecting to The Service
- Purchase Flow
- Transactions Validation
- Subscriptions
- Licensing
- Getting Started
- Games Sing-in
- Server-side API Access
- Leaderboards
- Achievements
- Saved Games
- Image Manager
- Settings Intent