Skip to content

Commit

Permalink
repackaged code from platform-specific navigation modules to within c…
Browse files Browse the repository at this point in the history
…ommon navigation module, simplifying the dependency situation
  • Loading branch information
Ninjars committed Aug 14, 2023
1 parent d939568 commit 938bd67
Show file tree
Hide file tree
Showing 35 changed files with 79 additions and 111 deletions.
1 change: 0 additions & 1 deletion appyx-navigation/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id("org.jetbrains.compose")
id("com.android.library")
kotlin("android")
id("appyx-publish-android")
id("appyx-lint")
id("kotlin-parcelize")
id("appyx-detekt")
Expand Down
21 changes: 21 additions & 0 deletions appyx-navigation/common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id("org.jetbrains.compose")
id("com.android.library")
id("appyx-publish-multiplatform")
id("appyx-detekt")
}

kotlin {
Expand Down Expand Up @@ -40,7 +41,12 @@ kotlin {
dependencies {
api(libs.androidx.appcompat)
api(libs.androidx.core)
api(libs.compose.runtime)
api(libs.compose.ui.tooling)

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle.java8)

}
}
val desktopMain by getting {
Expand Down Expand Up @@ -70,4 +76,19 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
}
testOptions {
}

dependencies {
val composeBom = platform(libs.compose.bom)

api(composeBom)

androidTestImplementation(composeBom)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.test.junit)
androidTestImplementation(libs.compose.ui.test.junit4)
androidTestImplementation(libs.compose.foundation)
androidTestImplementation(project(":utils:testing-ui"))
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import android.app.Activity
import android.content.Context
import android.content.ContextWrapper
import android.content.Intent
import android.os.Bundle
import com.bumble.appyx.navigation.integrationpoint.activitystarter.ActivityBoundary
import com.bumble.appyx.navigation.integrationpoint.activitystarter.ActivityStarter
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequestBoundary
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequester
import com.bumble.appyx.navigation.integration.activitystarter.ActivityBoundary
import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequestBoundary
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester
import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider

open class ActivityIntegrationPoint(
private val activity: Activity,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import android.os.Bundle
import androidx.compose.runtime.Stable
import com.bumble.appyx.navigation.integrationpoint.activitystarter.ActivityStarter
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequester
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeRegistry
import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeRegistry
import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint

@Stable
abstract class AndroidIntegrationPoint(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import androidx.compose.runtime.staticCompositionLocalOf
import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint

val LocalIntegrationPoint = staticCompositionLocalOf<IntegrationPoint> {
error("CompositionLocal LocalIntegrationPoint not present")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider

/**
* Helper class for root [Node] integration into projects using [AppCompatActivity].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import com.bumble.appyx.navigation.integrationpoint.IntegrationPointProvider

/**
* Helper class for root [Node] integration into projects using [ComponentActivity].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.bumble.appyx.navigation.integrationpoint.activitystarter
package com.bumble.appyx.navigation.integration.activitystarter

import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.fragment.app.Fragment
import com.bumble.appyx.navigation.integrationpoint.activitystarter.ActivityStarter.ActivityResultEvent
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStreamImpl
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeRegistry
import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter.ActivityResultEvent
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStreamImpl
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeRegistry

class ActivityBoundary(
private val activityStarterHost: ActivityStarterHost,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.activitystarter
package com.bumble.appyx.navigation.integration.activitystarter

import android.content.Intent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.bumble.appyx.navigation.integrationpoint.activitystarter
package com.bumble.appyx.navigation.integration.activitystarter

import android.content.Context
import android.content.Intent
import com.bumble.appyx.navigation.integrationpoint.activitystarter.ActivityStarter.ActivityResultEvent
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStream
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integration.activitystarter.ActivityStarter.ActivityResultEvent
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStream
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeClient

/**
* Start Activities.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.activitystarter
package com.bumble.appyx.navigation.integration.activitystarter

import android.app.Activity
import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.activitystarter
package com.bumble.appyx.navigation.integration.activitystarter

interface CanProvideActivityStarter {
val activityStarter: ActivityStarter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.bumble.appyx.navigation.integrationpoint.permissionrequester
package com.bumble.appyx.navigation.integration.permissionrequester

import android.app.Activity
import android.content.pm.PackageManager
import androidx.fragment.app.Fragment
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequester.CheckPermissionsResult
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequester.RequestPermissionsEvent.Cancelled
import com.bumble.appyx.navigation.integrationpoint.permissionrequester.PermissionRequester.RequestPermissionsEvent.RequestPermissionsResult
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStreamImpl
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeRegistry
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester.CheckPermissionsResult
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester.RequestPermissionsEvent.Cancelled
import com.bumble.appyx.navigation.integration.permissionrequester.PermissionRequester.RequestPermissionsEvent.RequestPermissionsResult
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStreamImpl
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeRegistry

class PermissionRequestBoundary(
private val permissionRequesterHost: PermissionRequesterHost,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.permissionrequester
package com.bumble.appyx.navigation.integration.permissionrequester

interface PermissionRequestResultHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.bumble.appyx.navigation.integrationpoint.permissionrequester
package com.bumble.appyx.navigation.integration.permissionrequester

import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStream
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeClient
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStream
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeClient

interface PermissionRequester :
RequestCodeBasedEventStream<PermissionRequester.RequestPermissionsEvent> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.permissionrequester
package com.bumble.appyx.navigation.integration.permissionrequester

import android.app.Activity
import android.content.pm.PackageManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.requestcode
package com.bumble.appyx.navigation.integration.requestcode

import kotlinx.coroutines.flow.Flow

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.bumble.appyx.navigation.integrationpoint.requestcode
package com.bumble.appyx.navigation.integration.requestcode

import com.bumble.appyx.navigation.integrationpoint.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import com.bumble.appyx.navigation.integration.requestcode.RequestCodeBasedEventStream.RequestCodeBasedEvent
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.requestcode
package com.bumble.appyx.navigation.integration.requestcode

interface RequestCodeClient {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.bumble.appyx.navigation.integrationpoint.requestcode
package com.bumble.appyx.navigation.integration.requestcode

class RequestCodeDoesntFitInMask(override val message: String?) : RuntimeException(message)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint.requestcode
package com.bumble.appyx.navigation.integration.requestcode

import android.os.Bundle
import kotlin.math.pow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
Expand All @@ -8,9 +8,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.window.WindowState
import com.bumble.appyx.navigation.integration.NodeFactory
import com.bumble.appyx.navigation.integration.NodeHost
import com.bumble.appyx.navigation.integration.ScreenSize
import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint
import com.bumble.appyx.navigation.node.Node
import com.bumble.appyx.navigation.platform.LocalOnBackPressedDispatcherOwner
import com.bumble.appyx.navigation.platform.OnBackPressedDispatcher
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint
import kotlin.system.exitProcess
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.bumble.appyx.navigation.integrationpoint
package com.bumble.appyx.navigation.integration

import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import com.bumble.appyx.navigation.integration.NodeFactory
import com.bumble.appyx.navigation.integration.NodeHost
import com.bumble.appyx.navigation.integration.ScreenSize
import com.bumble.appyx.navigation.integrationpoint.IntegrationPoint
import com.bumble.appyx.navigation.node.Node
import com.bumble.appyx.navigation.platform.LocalOnBackPressedDispatcherOwner
Expand Down
22 changes: 0 additions & 22 deletions appyx-navigation/desktop/build.gradle.kts

This file was deleted.

26 changes: 0 additions & 26 deletions appyx-navigation/web/build.gradle.kts

This file was deleted.

1 change: 0 additions & 1 deletion demos/appyx-navigation/android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ dependencies {
val composeBom = platform(libs.compose.bom)

implementation(composeBom)
implementation(project(":appyx-navigation:android"))
implementation(project(":demos:common"))
implementation(project(":demos:appyx-navigation:common"))
implementation(project(":appyx-interactions:appyx-interactions"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.ExperimentalUnitApi
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.bumble.appyx.navigation.integration.NodeActivity
import com.bumble.appyx.navigation.integration.NodeHost
import com.bumble.appyx.navigation.integrationpoint.NodeActivity
import com.bumble.appyx.navigation.modality.BuildContext
import com.bumble.appyx.navigation.node.container.ContainerNode
import com.bumble.appyx.navigation.platform.AndroidLifecycle
Expand Down
1 change: 0 additions & 1 deletion demos/appyx-navigation/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ kotlin {
implementation(project(":demos:appyx-navigation:common"))
implementation(project(":appyx-interactions:appyx-interactions"))
implementation(project(":appyx-navigation:appyx-navigation"))
implementation(project(":appyx-navigation:desktop"))
implementation(project(":appyx-components:stable:backstack:backstack"))
api(compose.runtime)
api(compose.foundation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.bumble.appyx.navigation.integrationpoint.DesktopNodeHost
import com.bumble.appyx.navigation.integration.DesktopNodeHost
import com.bumble.appyx.navigation.node.container.ContainerNode
import com.bumble.appyx.navigation.ui.AppyxSampleAppTheme
import kotlinx.coroutines.CoroutineScope
Expand Down
1 change: 0 additions & 1 deletion demos/appyx-navigation/web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ kotlin {
implementation(project(":demos:appyx-navigation:common"))
implementation(project(":appyx-interactions:appyx-interactions"))
implementation(project(":appyx-navigation:appyx-navigation"))
implementation(project(":appyx-navigation:web"))
implementation(project(":appyx-components:stable:backstack:backstack"))
api(compose.runtime)
api(compose.foundation)
Expand Down
Loading

0 comments on commit 938bd67

Please sign in to comment.