Repository navigation
feat(android-nav3): Android Nav3 integration #6128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
df8e13a
collection: android nav3
0xadam-brown 7300862
feat(android-nav3): [Android Nav3 1] Create navigation3 module (JAVA-…
0xadam-brown 5c8bd0a
feat(android-nav3): [Android Nav3 2] Model navigation routes (JAVA-27…
0xadam-brown d825db7
feat(android-nav3): [Android Nav3 3] Track navigation state transitio…
0xadam-brown ecb6243
feat(android-nav3): [Android Nav3 4] Introduce SentryNavEffect (#6132)
0xadam-brown da14227
feat(android): Make SentryNavEffect API public for sample app purpose…
0xadam-brown a4d1f06
Re-run apiDump
0xadam-brown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
51 changes: 51 additions & 0 deletions
51
sentry-android-navigation3/api/sentry-android-navigation3.api
This file contains hidden or 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,51 @@ | ||
| public final class io/sentry/compose/navigation3/BuildConfig { | ||
| public static final field BUILD_TYPE Ljava/lang/String; | ||
| public static final field DEBUG Z | ||
| public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; | ||
| public static final field VERSION_NAME Ljava/lang/String; | ||
| public fun <init> ()V | ||
| } | ||
|
|
||
| public abstract interface class io/sentry/compose/navigation3/RouteArgumentsExtractor { | ||
| public abstract fun extract (Ljava/lang/Object;)Ljava/util/Map; | ||
| } | ||
|
|
||
| public abstract interface class io/sentry/compose/navigation3/RouteNameExtractor { | ||
| public abstract fun extract (Ljava/lang/Object;)Ljava/lang/String; | ||
| } | ||
|
|
||
| public final class io/sentry/compose/navigation3/SentryNavEffectKt { | ||
| public static final fun SentryNavEffect (Ljava/util/List;Lio/sentry/compose/navigation3/RouteNameExtractor;Lio/sentry/compose/navigation3/RouteArgumentsExtractor;Lio/sentry/compose/navigation3/SentryNavOptions;Landroidx/compose/runtime/Composer;II)V | ||
| } | ||
|
|
||
| public final class io/sentry/compose/navigation3/SentryNavOptions { | ||
| public static final field $stable I | ||
| public synthetic fun <init> (ZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V | ||
| public fun equals (Ljava/lang/Object;)Z | ||
| public final fun getCaptureBackStack ()Z | ||
| public final fun getEnableNavigationBreadcrumbs ()Z | ||
| public final fun getEnableNavigationTransactions ()Z | ||
| public final fun getMaxCapturedBackStackEntries ()I | ||
| public fun hashCode ()I | ||
| public fun toString ()Ljava/lang/String; | ||
| } | ||
|
|
||
| public final class io/sentry/compose/navigation3/SentryNavOptions$Builder { | ||
| public static final field $stable I | ||
| public fun <init> ()V | ||
| public final fun build ()Lio/sentry/compose/navigation3/SentryNavOptions; | ||
| public final fun getCaptureBackStack ()Z | ||
| public final fun getEnableNavigationBreadcrumbs ()Z | ||
| public final fun getEnableNavigationTransactions ()Z | ||
| public final fun getMaxCapturedBackStackEntries ()I | ||
| public final fun setCaptureBackStack (Z)V | ||
| public final fun setEnableNavigationBreadcrumbs (Z)V | ||
| public final fun setEnableNavigationTransactions (Z)V | ||
| public final fun setMaxCapturedBackStackEntries (I)V | ||
| } | ||
|
|
||
| public final class io/sentry/compose/navigation3/SentryNavOptionsKt { | ||
| public static final fun SentryNavOptions (Lkotlin/jvm/functions/Function1;)Lio/sentry/compose/navigation3/SentryNavOptions; | ||
| public static synthetic fun SentryNavOptions$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/sentry/compose/navigation3/SentryNavOptions; | ||
| } | ||
|
|
This file contains hidden or 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,78 @@ | ||
| import io.gitlab.arturbosch.detekt.Detekt | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||
| import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
|
|
||
| plugins { | ||
| id("com.android.library") | ||
| alias(libs.plugins.kotlin.android) | ||
| alias(libs.plugins.kotlin.compose) | ||
| alias(libs.plugins.gradle.versions) | ||
| alias(libs.plugins.detekt) | ||
| } | ||
|
|
||
| android { | ||
| compileSdk = libs.versions.compileSdk.get().toInt() | ||
| namespace = "io.sentry.compose.navigation3" | ||
|
|
||
| defaultConfig { | ||
| minSdk = libs.versions.minSdk.get().toInt() | ||
|
|
||
| buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") | ||
| } | ||
|
|
||
| buildTypes { | ||
| getByName("release") { consumerProguardFiles("proguard-rules.pro") } | ||
| } | ||
|
|
||
| // AGP 9 only generates unit tests for the testBuildType. The debug variant is | ||
| // disabled, so unit tests must target release to run at all. | ||
| testBuildType = "release" | ||
|
|
||
| kotlin { | ||
| compilerOptions.jvmTarget = JVM_1_8 | ||
| compilerOptions.languageVersion = KotlinVersion.KOTLIN_1_9 | ||
| compilerOptions.apiVersion = KotlinVersion.KOTLIN_1_9 | ||
| } | ||
|
|
||
| testOptions { | ||
| unitTests.isReturnDefaultValues = true | ||
| } | ||
|
|
||
| lint { | ||
| warningsAsErrors = true | ||
| checkDependencies = true | ||
|
|
||
| // We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks. | ||
| checkReleaseBuilds = false | ||
| } | ||
|
|
||
| buildFeatures { | ||
| buildConfig = true | ||
| compose = true | ||
| } | ||
|
|
||
| androidComponents.beforeVariants { | ||
| it.enable = !Config.Android.shouldSkipDebugVariant(it.buildType) | ||
| } | ||
| } | ||
|
|
||
| kotlin { explicitApi() } | ||
|
|
||
| dependencies { | ||
| implementation(projects.sentry) | ||
|
|
||
| compileOnly(libs.androidx.compose.runtime) | ||
|
|
||
| testImplementation(libs.androidx.compose.ui.test.junit4) | ||
| testImplementation(libs.androidx.test.core) | ||
| testImplementation(libs.androidx.test.ext.junit) | ||
| testImplementation(libs.google.truth) | ||
| testImplementation(libs.mockito.inline) | ||
| testImplementation(libs.mockito.kotlin) | ||
| testImplementation(libs.roboelectric) | ||
| } | ||
|
|
||
| tasks.withType<Detekt>().configureEach { | ||
| // Target version of the generated JVM bytecode. It is used for type resolution. | ||
| jvmTarget = JavaVersion.VERSION_1_8.toString() | ||
| } | ||
This file contains hidden or 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,7 @@ | ||
| ##---------------Begin: proguard configuration for Compose ---------- | ||
|
|
||
| # To ensure that stack traces is unambiguous | ||
| # https://developer.android.com/studio/build/shrink-code#decode-stack-trace | ||
| -keepattributes LineNumberTable,SourceFile | ||
|
|
||
| ##---------------End: proguard configuration for Compose ---------- |
35 changes: 35 additions & 0 deletions
35
sentry-android-navigation3/src/main/kotlin/io/sentry/compose/navigation3/BackStackKey.kt
This file contains hidden or 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,35 @@ | ||
| package io.sentry.compose.navigation3 | ||
|
|
||
| /** | ||
| * A key for distinguishing back stacks over time. | ||
| * | ||
| * Lets `*Effect`s restart when either the identity of a stack entry changes or the stack's entries | ||
| * are reordered. | ||
| */ | ||
| internal class BackStackKey<T : Any>(private val backStack: List<T>) { | ||
|
|
||
| override fun equals(other: Any?): Boolean { | ||
| // Use of identity rather than structural equality frees us from entries' equals() and | ||
| // hashCode() implementations, which are provided by the host app and may be incomplete, | ||
| // expensive, or incorrect for our purposes. | ||
| if (this === other) { | ||
| return true | ||
| } | ||
| if (other !is BackStackKey<*>) { | ||
| return false | ||
| } | ||
| if (backStack.size != other.backStack.size) { | ||
| return false | ||
| } | ||
|
|
||
| return backStack.indices.all { index -> backStack[index] === other.backStack[index] } | ||
| } | ||
|
|
||
| override fun hashCode(): Int { | ||
| var result = backStack.size | ||
| for (entry in backStack) { | ||
| result = 31 * result + System.identityHashCode(entry) | ||
| } | ||
| return result | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.