Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Latest commit

 

History

History
33 lines (23 loc) · 831 Bytes

LIFECYCLE.md

File metadata and controls

33 lines (23 loc) · 831 Bytes

Lifecycle

Table of Contents

  1. Gradle Dependency
  2. Usage

Gradle Dependency

Lifecycle

The lifecycle module contains extensions to make dialogs work with AndroidX lifecycles.

dependencies {
  ...
  implementation 'com.afollestad.material-dialogs:lifecycle:3.2.1'
}

Usage

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.