|
@@ -8,6 +8,7 @@
|
|
|
[  ](https://bintray.com/drummer-aidan/maven/material-dialogs%3Ainput/_latestVersion)
|
|
|
[  ](https://bintray.com/drummer-aidan/maven/material-dialogs%3Afiles/_latestVersion)
|
|
|
[  ](https://bintray.com/drummer-aidan/maven/material-dialogs%3Acolor/_latestVersion)
|
|
|
+[  ](https://bintray.com/drummer-aidan/maven/material-dialogs%3Alifecycle/_latestVersion)
|
|
|
|
|
|
#### [View Releases and Changelogs](https://github.com/afollestad/material-dialogs/releases)
|
|
|
|
|
@@ -69,6 +70,11 @@
|
|
|
1. [Basics](#basics-4)
|
|
|
2. [Sub Colors](#sub-colors)
|
|
|
|
|
|
+# Table of Contents - Lifecycle
|
|
|
+
|
|
|
+1. [Gradle Dependency](#gradle-dependency-4)
|
|
|
+2. [Usage](#usage)
|
|
|
+
|
|
|
---
|
|
|
|
|
|
# Core
|
|
@@ -1081,3 +1087,33 @@ MaterialDialog(this).show {
|
|
|
```
|
|
|
|
|
|
Omitting `showAlphaSelector` will hide the alpha (transparency) selector.
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+# Lifecycle
|
|
|
+
|
|
|
+## Gradle Dependency
|
|
|
+
|
|
|
+[  ](https://bintray.com/drummer-aidan/maven/material-dialogs%3Alifecycle/_latestVersion)
|
|
|
+
|
|
|
+The `lifecycle` module contains extensions to make dialogs work with AndroidX lifecycles.
|
|
|
+
|
|
|
+```gradle
|
|
|
+dependencies {
|
|
|
+ ...
|
|
|
+ implementation 'com.afollestad.material-dialogs:lifecycle:2.0.3'
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+## Usage
|
|
|
+
|
|
|
+```kotlin
|
|
|
+MaterialDialog(this).show {
|
|
|
+ ...
|
|
|
+ lifecycleOwner(owner)
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+When the given lifecycle owner is destroyed, the dialog is automatically dismissed. Lifecycle
|
|
|
+owners include Activities and Fragments from AndroidX, along with any class that implements the
|
|
|
+`LifecycleOwner` interface.
|