Package-level declarations
Types
A BroadcastReceiver that calls goAsync and launches a coroutine to execute long-running tasks. The receive method is still executed on main thread, move to another thread as needed.
Contract for picking ringtones. Returns one of:
A web client that solves many problems of WebViewClient and provides a nice API to use. This client automatically sets JS as enabled. You can override this behavior by calling WebSettings.setJavaScriptEnabled. Only domains in allowedHosts will be opened in the webview, others will trigger WebClientListener.onForeignUrlEncountered. Don't forget to attach the client in onViewCreated and detach it in onDestroyView.
A listener for events that happen in WebClient
Properties
Get the current system AutofillManager if present.
Returns the currently used locale on the device. Returns the first locale the user has listed in the system settings.
Returns whether the system is set to 24-hour time format right now.
Get the uri of this app's package.
Create a spannable string
Functions
Allows background activity start for this intent starting with SDK 34 (Upside down cake). On previous versions, does nothing.
Use this Uri as a deeplink intent, i.e. open this uri in a new task.
Uses this int as a resource id to get a drawable
Changes the background color of the text to color.
Applies bold style to this string
Create a SpannableStringBuilder from this
If this is a color int, turns it into a hex string.
Saves file using DownloadManager to users /sdcard/directory
Changes the color of the text to color.
This function will query the ApplicationInfo of the packageName provided.
Get dimension dp value from your xml. When you use Resources.getDimension you get the amount of pixels for that dimen. This function returns a proper dp value just like what you wrote in your dimen.xml
Get an uri to a google play store page of this app.
Will get a full list of userspace apps installed on the device + some of the system apps that can be resolved.
Returns an uri to the given resourceId. This uri is NOT safe to store outside of app lifecycle!
Applies italic style to this string
Start activity safely and handle errors where an activity is not found.
Open system notification settings for the current app.
Open the app's play store page.
Open the system browser for the specified url.
Open system notification settings for this app.
Open system overlay (SYSTEM_ALERT_WINDOW) settings.
This function will query the resolvable (exported) activities of the target intent using this PackageManager. This is useful when you want to start another app.
Sets the size of this string to relative size size, which is a multiplier fraction larger than 0
Request a permission too schedule exact alarms from the user. This will bring the user to a page that prompts them to flip a switch for your app.
Display a prompt to ignore Doze mode optimizations and unrestrict AlarmManager APIs for this app.
Restart the current activity in a new task.
span is a ..Span object like a ForegroundColorSpan or a SuperscriptSpan Spans this whole string
Open the system share sheet for sharing the specified text.
span is a ..Span object like a ForegroundColorSpan or a SuperscriptSpan Spans this whole string
Start activity safely and handle errors where an activity is not found.
Strikes this string through
Sets this string to be drawn as a superscript (smaller font aligned to the bottom of the text)
Sets this string to be drawn as a superscript (smaller font aligned to the top of the text, such as numeric power)
Adds an underline to this string
Execute since if the current sdk version is at least versionCode. Version code comes from Build.VERSION_CODES.
Execute since if the current sdk version is at least versionCode, otherwise execute below
Create a span with a clickablePart of the text, and invokes the onClickListener on click.
Execute ifGranted if the permission has been granted, otherwise do nothing.
Execute ifGranted if the permission has been granted, otherwise execute ifDenied.