-
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.
Rename the interfaces, methods, and objects to be somewhat Activity a…
…gnostic
- Loading branch information
1 parent
51bf6ce
commit bdb9785
Showing
16 changed files
with
192 additions
and
170 deletions.
There are no files selected for viewing
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
13 changes: 13 additions & 0 deletions
13
...src/main/kotlin/io/embrace/android/embracesdk/internal/capture/activity/LifecycleStage.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package io.embrace.android.embracesdk.internal.capture.activity | ||
|
||
/** | ||
* The defined stages in the UI Load lifecycle for which child spans will be logged, if applicable. | ||
*/ | ||
enum class LifecycleStage(private val typeName: String) { | ||
CREATE("create"), | ||
START("start"), | ||
RESUME("resume"), | ||
RENDER("render"); | ||
|
||
fun spanName(componentName: String): String = "$componentName-$typeName" | ||
} |
76 changes: 76 additions & 0 deletions
76
...ain/kotlin/io/embrace/android/embracesdk/internal/capture/activity/UiLoadEventListener.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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package io.embrace.android.embracesdk.internal.capture.activity | ||
|
||
/** | ||
* Listener to handle relevant events during the lifecycle of UI loading. Implementations should gather the data and log | ||
* the appropriate loading traces and spans. | ||
*/ | ||
interface UiLoadEventListener { | ||
|
||
/** | ||
* When the given UI instance is starting to be created. | ||
* | ||
* For an Activity, it means it has entered the CREATED state of its lifecycle. | ||
*/ | ||
fun create(instanceId: Int, activityName: String, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance has been fully created and is ready to be displayed on screen. | ||
* | ||
* For an Activity, it means it is about to exit CREATED state of its lifecycle. | ||
*/ | ||
fun createEnd(instanceId: Int, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is starting to be displayed on screen | ||
* | ||
* For an Activity, it means it is about to enter the STARTED state of its lifecycle. | ||
*/ | ||
fun start(instanceId: Int, activityName: String, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is displayed on screen and its views are ready to be rendered | ||
* | ||
* For an Activity, it means it is about to exit the STARTED state of its lifecycle. | ||
*/ | ||
fun startEnd(instanceId: Int, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is getting ready to be rendered | ||
* | ||
* For an Activity, it means it is about to enter the RESUMED state of its lifecycle. | ||
*/ | ||
fun resume(instanceId: Int, activityName: String, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is ready to start rendering. | ||
* | ||
* For an Activity, it means it is about to exit the RESUMED state of its lifecycle. | ||
*/ | ||
fun resumeEnd(instanceId: Int, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is starting to render | ||
* | ||
* For an Activity, it means when its root View is begin to render | ||
*/ | ||
fun render(instanceId: Int, activityName: String, timestampMs: Long) | ||
|
||
/** | ||
* When the given UI instance is has rendered its first frame | ||
* | ||
* For an Activity, it means when the first frame associated with its Window has delivered its first frame. | ||
*/ | ||
fun renderEnd(instanceId: Int, timestampMs: Long) | ||
|
||
/** | ||
* When we no longer wish to observe the loading of the given UI instance. This may be called during its load | ||
* or after it has loaded. Calls to this for a given instance should be idempotent. | ||
*/ | ||
fun abandon(instanceId: Int, activityName: String, timestampMs: Long) | ||
|
||
/** | ||
* When the app is no longer in a state where it is trying to open up UI. All traces should be abandoned and | ||
* Any events received after this should assume the app is emerging or have emerged from a background state. | ||
*/ | ||
fun reset(lastInstanceId: Int) | ||
} |
59 changes: 0 additions & 59 deletions
59
...s/src/main/kotlin/io/embrace/android/embracesdk/internal/capture/activity/UiLoadEvents.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.