-
Notifications
You must be signed in to change notification settings - Fork 1
AboutAlertDialog
Leonardo D. Palma edited this page Mar 27, 2025
·
2 revisions
Create and display a dialog box with information about.
In code:
AboutAlertDialog.Builder(applicationContext)
.setApplicationIcon(R.mipmap.ic_launcher_round)
.setApplicationName(R.string.app_name)
.setApplicationVersion("Lorem Ipsum")
.setApplicationLegalese("What is Lorem Ipsum?")
.setCancelable(false)
.setPositiveButton(object : DialogAlertInterface.OnClickListener {
override fun onClick(dialog: DialogAlertInterface, whichButton: DialogAlertInterface.UI) {
TODO("Not yet implemented")
}
})
.create()
.show()AboutAlertDialog offers several attributes for a deeper view configuration, the following table shows all these options and their default value.
| Name | Description | Values | Default | Related method(s) |
|---|---|---|---|---|
| Builder | Creates a builder for an alert dialog that uses the default alert dialog theme | Context |
N/A | Builder() |
| BackgroundIconTintColor | Set background tint for icon |
Int, rgb(R,G,B)
|
N/A | setIconTintColor() |
| BackgroundIconTintColor | Set background tint for icon | IntRes |
N/A | setIconTintColorRes() |
| Icon | Set the drawable resource to be used in the icon | Int |
R.mipmap.ic_launcher_round |
setApplicationIcon() |
| Icon Store | Set an extra icon in the options | Int |
R.drawable.ic_baseline_git_svg |
setApplicationIconStore() |
| Icon Store visible | Icon visible or not | Boolean |
true |
setIconStoreVisible() |
| Title | Set the application name displayed |
String, Int
|
N/A | setApplicationName() |
| Message | Sets the version to display |
String, Int
|
N/A | setApplicationVersion() |
| Span | Sets the legalese to display |
String, Int
|
N/A | setApplicationLegalese() |
| Max Span | Set the maximum length text legalese |
String, Int
|
N/A | setMaxLength() |
| Details | Sets the details to display | Int |
N/A | setApplicationDetails() |
| Max Details | Set the maximum length text details | Int |
N/A | setMaxLengthDetails() |
| Gravity | Set gravity of the dialog |
Int [android.view.Gravity] |
N/A | setGravity() |
| Count Down Timer | Set a countdown on one of the buttons | (DialogAlertInterface.UI, Long) |
N/A | setCountDownTimer() |
| Cancelable | Sets whether the dialog is cancelable or not | Boolean |
true |
setCancelable() |
| PositiveButton | Set a listener to be invoked when the positive button of the dialog is pressed |
String or Int
|
N/A | setPositiveButton() |
| NeutralButton | Set a listener to be invoked when the neutral button of the dialog is pressed |
String or Int
|
N/A | setNeutralButton() |
| NegativeButton | Set a listener to be invoked when the negative button of the dialog is pressed |
String or Int
|
N/A | setNegativeButton() |
| create | Creates an AboutAlertDialog with the arguments supplied to this builder | - | - | create() |
| show | Start the dialog and display it on screen | - | - | show() |
If you want to add more functionality to dialog events, you can use the following methods to capture the actions.
- When the
dismissoption is called from the dialog box, you can use thesetOnDismissListenermethod to perform additional actions. - When the
canceloption is called from the dialog box, you can use thesetOnCancelListenermethod to perform additional actions. - When the
showoption is called from the dialog box, you can use thesetOnShowListenermethod to perform additional actions. - Get the button with the specified type, you can use the
getButtonmethod to perform additional actions. - Sets a timeout for the dialog to automatically dismiss after a specified duration, you can use the
setTimeoutmethod to perform additional actions.