-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configured feature modules in sample app
- Loading branch information
Showing
18 changed files
with
195 additions
and
25 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
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
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
7 changes: 7 additions & 0 deletions
7
samples/simple-android/app/src/main/java/io/morfly/airin/sample/AirinSampleApplication.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,7 @@ | ||
package io.morfly.airin.sample | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class AirinSampleApplication : Application() |
21 changes: 21 additions & 0 deletions
21
samples/simple-android/app/src/main/java/io/morfly/airin/sample/AirinSampleNavHost.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,21 @@ | ||
package io.morfly.airin.sample | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.navigation.compose.NavHost | ||
import androidx.navigation.compose.rememberNavController | ||
import io.morfly.airin.sample.featureA.navigation.firstScreen | ||
import io.morfly.airin.sample.featureA.navigation.firstScreenRoute | ||
import io.morfly.airin.sample.featureB.navigation.navigateToSecondScreen | ||
import io.morfly.airin.sample.featureB.navigation.secondScreen | ||
|
||
|
||
@Composable | ||
fun AirinSampleNavHost() { | ||
|
||
val navController = rememberNavController() | ||
|
||
NavHost(navController = navController, startDestination = firstScreenRoute) { | ||
firstScreen(onNextClick = navController::navigateToSecondScreen) | ||
secondScreen(onNextClick = {}) | ||
} | ||
} |
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
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
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
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,17 @@ | ||
plugins { | ||
alias(sampleLibs.plugins.sample.android.library) | ||
alias(sampleLibs.plugins.sample.android.compose) | ||
alias(sampleLibs.plugins.hilt.android) | ||
alias(sampleLibs.plugins.ksp) | ||
} | ||
|
||
android { | ||
namespace = "io.morfly.airin.sample.featureA" | ||
} | ||
|
||
dependencies { | ||
implementation(sampleLibs.compose.navigation) | ||
implementation(sampleLibs.compose.navigation.hilt) | ||
implementation(sampleLibs.hilt.android) | ||
ksp(sampleLibs.hilt.android.compiler) | ||
} |
21 changes: 21 additions & 0 deletions
21
...ure-A/src/main/kotlin/io/morfly/airin/sample/featureA/navigation/FirstScreenNavigation.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,21 @@ | ||
package io.morfly.airin.sample.featureA.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavOptions | ||
import androidx.navigation.compose.composable | ||
import io.morfly.airin.sample.featureA.ui.FirstScreen | ||
|
||
const val firstScreenRoute = "first_screen_route" | ||
|
||
fun NavController.navigateToFirstScreen(navOptions: NavOptions? = null) { | ||
navigate(firstScreenRoute, navOptions) | ||
} | ||
|
||
fun NavGraphBuilder.firstScreen( | ||
onNextClick: () -> Unit | ||
) { | ||
composable(firstScreenRoute) { | ||
FirstScreen(onNextClick = onNextClick) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...imple-android/feature-A/src/main/kotlin/io/morfly/airin/sample/featureA/ui/FirstScreen.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,19 @@ | ||
package io.morfly.airin.sample.featureA.ui | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
|
||
@Composable | ||
fun FirstScreen( | ||
modifier: Modifier = Modifier, | ||
onNextClick: () -> Unit, | ||
viewModel: FirstViewModel = hiltViewModel() | ||
) { | ||
Text( | ||
text = "FirstScreen", | ||
Modifier.clickable { onNextClick() } | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
...le-android/feature-A/src/main/kotlin/io/morfly/airin/sample/featureA/ui/FirstViewModel.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,9 @@ | ||
package io.morfly.airin.sample.featureA.ui | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class FirstViewModel @Inject constructor(): ViewModel() { | ||
} |
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,17 @@ | ||
plugins { | ||
alias(sampleLibs.plugins.sample.android.library) | ||
alias(sampleLibs.plugins.sample.android.compose) | ||
alias(sampleLibs.plugins.hilt.android) | ||
alias(sampleLibs.plugins.ksp) | ||
} | ||
|
||
android { | ||
namespace = "io.morfly.airin.sample.featureB" | ||
} | ||
|
||
dependencies { | ||
implementation(sampleLibs.compose.navigation) | ||
implementation(sampleLibs.compose.navigation.hilt) | ||
implementation(sampleLibs.hilt.android) | ||
ksp(sampleLibs.hilt.android.compiler) | ||
} |
21 changes: 21 additions & 0 deletions
21
...re-B/src/main/kotlin/io/morfly/airin/sample/featureB/navigation/SecondScreenNavigation.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,21 @@ | ||
package io.morfly.airin.sample.featureB.navigation | ||
|
||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavOptions | ||
import androidx.navigation.compose.composable | ||
import io.morfly.airin.sample.featureB.ui.SecondScreen | ||
|
||
const val secondScreenRoute = "second_screen_route" | ||
|
||
fun NavController.navigateToSecondScreen(navOptions: NavOptions? = null) { | ||
navigate(secondScreenRoute, navOptions) | ||
} | ||
|
||
fun NavGraphBuilder.secondScreen( | ||
onNextClick: () -> Unit | ||
) { | ||
composable(secondScreenRoute) { | ||
SecondScreen(onNextClick = onNextClick) | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...mple-android/feature-B/src/main/kotlin/io/morfly/airin/sample/featureB/ui/SecondScreen.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,19 @@ | ||
package io.morfly.airin.sample.featureB.ui | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
|
||
@Composable | ||
fun SecondScreen( | ||
modifier: Modifier = Modifier, | ||
onNextClick: () -> Unit, | ||
viewModel: SecondViewModel = hiltViewModel() | ||
) { | ||
Text( | ||
text = "FirstScreen", | ||
Modifier.clickable { onNextClick() } | ||
) | ||
} |
9 changes: 9 additions & 0 deletions
9
...e-android/feature-B/src/main/kotlin/io/morfly/airin/sample/featureB/ui/SecondViewModel.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,9 @@ | ||
package io.morfly.airin.sample.featureB.ui | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class SecondViewModel @Inject constructor(): ViewModel() { | ||
} |
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,3 @@ | ||
plugins { | ||
kotlin("jvm") | ||
} |
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,3 @@ | ||
plugins { | ||
kotlin("jvm") | ||
} |