This library adds support for testing the lifecycle module to test-utils.
Installing
This library is available on Maven Central. You can import Kaluga Test Utils Lifecycle as follows:
repositories {
// ...
mavenCentral()
}
// ...
dependencies {
// ...
implementation("com.splendo.kaluga:test-utils-lifecycle:$kalugaVersion")
}
Helpers
On Android this library exposes:
AppCompatActivity.getOrPutAndRemoveOnDestroyFromCache— caches an instance ofTper activity and removes it onON_DESTROY.AppCompatActivity.lifecycleManagerObserver()— convenience that returns a per-activityLifecycleManagerObserversubscribed to that activity’s lifecycle. Used by the*Builder()helpers intest-utils-alerts,test-utils-hud,test-utils-keyboard, andtest-utils-date-time-picker.