Skip to content

Commit

Permalink
Inflow Navigation (#401)
Browse files Browse the repository at this point in the history
* feat:sdk-navigation

* feat: type safe nav wip

* fix: undo tests renaming

* feat: custom nav types

* feat: working nav

* feat:replace composables for enrollment with graph nav

* feat: main graph and reusable composble for nav

* feat: bump compose nav versions

* feat: refactor with seperation between orchestrated and indvidual screens

* fix: tests

* chore: bump compose navigation version

* feat: docs

* feat: main nav fixes

* feat: nav complete

* feat: nav complete

* feat: nav complete

* fix: unit tests for doc v and enhanced doc v

* feat: callbacks fixes

* feat: compose stack fixes and retries

* feat: pr feedback fixes

* feat: merge main

* feat: fix transition issue delay

* fix: nav cancelled actions

* feat: pop transitions

* feat: pop transitions on orch nav

---------

Co-authored-by: Juma Allan <[email protected]>
  • Loading branch information
JNdhlovu and jumaallan authored Oct 29, 2024
1 parent e9af69a commit 5ef6944
Show file tree
Hide file tree
Showing 23 changed files with 2,072 additions and 616 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Release Notes
(Unreleased)

* Added inflow navigation as well as individual navigation for compose screens
## 10.3.2

* Document capture throw OOM when encountered
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ tflite-support = "0.4.4"
timber = "5.0.1"
truth = "1.4.4"
uiautomator = "2.3.0"
kotlinxSerializationJson = "1.6.3"

[plugins]
android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" }
Expand All @@ -56,6 +57,7 @@ ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint-plugin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
moshix = { id = "dev.zacsweers.moshix", version.ref = "moshix" }
parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

[libraries]
accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanist-permissions" }
Expand All @@ -78,6 +80,7 @@ androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-kt
androidx-lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
androidx-navigation-testing = { module = "androidx.navigation:navigation-testing", version.ref = "androidx-navigation" }
androidx-test-core = { module = "androidx.test:core-ktx", version.ref = "androidx-test-core" }
androidx-test-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
androidx-test-fragment = { module = "androidx.fragment:fragment-testing", version.ref = "androidx-test-fragment" }
Expand Down Expand Up @@ -118,3 +121,4 @@ tflite-support = { group = "org.tensorflow", name = "tensorflow-lite-support", v
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
uiautomator = { module = "androidx.test.uiautomator:uiautomator", version.ref = "uiautomator" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
5 changes: 5 additions & 0 deletions lib/lib.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.maven.publish)
alias(libs.plugins.moshix)
alias(libs.plugins.parcelize)
alias(libs.plugins.kotlin.serialization)
}

val groupId = "com.smileidentity"
Expand Down Expand Up @@ -205,6 +206,9 @@ dependencies {
// Lottie Compose component
implementation(libs.lottie)

implementation(libs.androidx.navigation.compose)
implementation(libs.kotlinx.serialization.json)

// Unbundled model -- will be dynamically downloaded via Google Play Services
implementation(libs.play.services.mlkit.face.detection)

Expand All @@ -220,6 +224,7 @@ dependencies {
testImplementation(libs.coroutines.test)
testImplementation(libs.mockk)
androidTestImplementation(libs.mockk.android)
androidTestImplementation(libs.androidx.navigation.testing)

androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.rules)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import androidx.navigation.testing.TestNavHostController
import androidx.test.rule.GrantPermissionRule
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.PermissionState
Expand All @@ -14,6 +15,7 @@ import com.google.accompanist.permissions.rememberPermissionState
import com.google.accompanist.permissions.shouldShowRationale
import com.google.common.truth.Truth.assertThat
import com.smileidentity.R
import com.smileidentity.compose.nav.ResultCallbacks
import org.junit.Rule
import org.junit.Test

Expand All @@ -33,11 +35,14 @@ class DocumentCaptureScreenTest {
// given
val cameraPreviewTag = "document_camera_preview"
val instructionsTag = "document_capture_instructions_screen"
lateinit var navController: TestNavHostController

// when
composeTestRule.setContent {
permissionState = rememberPermissionState(Manifest.permission.CAMERA)
DocumentCaptureScreen(
navController = navController,
resultCallbacks = ResultCallbacks(),
jobId = "jobId",
side = DocumentCaptureSide.Front,
showInstructions = true,
Expand Down Expand Up @@ -67,10 +72,13 @@ class DocumentCaptureScreenTest {
val titleText = "Front of ID"
val subtitleText = "Make sure all the corners are visible and there is no glare"
val captureTitle = "captureTitle"
lateinit var navController: TestNavHostController

// when
composeTestRule.setContent {
DocumentCaptureScreen(
navController = navController,
resultCallbacks = ResultCallbacks(),
jobId = "jobId",
side = DocumentCaptureSide.Front,
showInstructions = true,
Expand Down
Loading

0 comments on commit 5ef6944

Please sign in to comment.