-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ActivityLifecycleListener extend ActivityLifecycleCallacks with …
…no-op defaults (#1124) ## Goal Make the listener implement `ActivityLifecycleCallbacks` with default no-op implementations so we can observe more lifecycle events.
- Loading branch information
1 parent
0a3fa76
commit a7d76f3
Showing
1 changed file
with
17 additions
and
24 deletions.
There are no files selected for viewing
41 changes: 17 additions & 24 deletions
41
...lin/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,25 @@ | ||
package io.embrace.android.embracesdk.internal.session.lifecycle | ||
|
||
import android.app.Activity | ||
import android.app.Application.ActivityLifecycleCallbacks | ||
import android.os.Bundle | ||
|
||
/** | ||
* Listener implemented by observers of the [ActivityLifecycleTracker]. | ||
* Implementation of [ActivityLifecycleCallbacks] with no-op defaults | ||
*/ | ||
public interface ActivityLifecycleListener { | ||
|
||
/** | ||
* Triggered when an activity is opened. | ||
* | ||
* @param activity details of the activity | ||
*/ | ||
public fun onActivityStarted(activity: Activity) {} | ||
|
||
/** | ||
* Triggered when an activity is closed. | ||
* | ||
* @param activity details of the activity | ||
*/ | ||
public fun onActivityStopped(activity: Activity) {} | ||
|
||
/** | ||
* Triggered when an activity is created. | ||
* | ||
* @param activity the activity | ||
* @param bundle the bundle | ||
*/ | ||
public fun onActivityCreated(activity: Activity, bundle: Bundle?) {} | ||
public interface ActivityLifecycleListener : ActivityLifecycleCallbacks { | ||
|
||
public override fun onActivityCreated(activity: Activity, bundle: Bundle?) {} | ||
|
||
public override fun onActivityStarted(activity: Activity) {} | ||
|
||
public override fun onActivityResumed(activity: Activity) {} | ||
|
||
public override fun onActivityPaused(activity: Activity) {} | ||
|
||
public override fun onActivityStopped(activity: Activity) {} | ||
|
||
public override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {} | ||
|
||
public override fun onActivityDestroyed(activity: Activity) {} | ||
} |