-
-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c39c80a
commit b71b0c9
Showing
29 changed files
with
123 additions
and
98 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
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
15 changes: 9 additions & 6 deletions
15
sample-multi-module/app/src/main/java/cafe/adriel/voyager/sample/multimodule/SampleApp.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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
package cafe.adriel.voyager.sample.multimodule | ||
|
||
import android.app.Application | ||
import cafe.adriel.voyager.sample.multimodule.featureb.featureBModule | ||
import org.kodein.di.DI | ||
import org.kodein.di.DIAware | ||
import cafe.adriel.voyager.core.registry.ScreenRegistry | ||
import cafe.adriel.voyager.sample.multimodule.posts.featurePostsScreenModule | ||
|
||
class SampleApp : Application(), DIAware { | ||
class SampleApp : Application() { | ||
|
||
override val di by DI.lazy { | ||
importAll(featureBModule) | ||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
ScreenRegistry { | ||
featurePostsScreenModule() | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...-module/feature-b/src/main/java/cafe/adriel/voyager/sample/multimodule/featureb/Module.kt
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
2 changes: 2 additions & 0 deletions
2
sample-multi-module/feature-home/src/main/AndroidManifest.xml
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,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="cafe.adriel.voyager.sample.multimodule.home"/> |
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
File renamed without changes.
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
2 changes: 2 additions & 0 deletions
2
sample-multi-module/feature-posts/src/main/AndroidManifest.xml
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,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="cafe.adriel.voyager.sample.multimodule.posts"/> |
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
13 changes: 13 additions & 0 deletions
13
.../feature-posts/src/main/java/cafe/adriel/voyager/sample/multimodule/posts/ScreenModule.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 cafe.adriel.voyager.sample.multimodule.posts | ||
|
||
import cafe.adriel.voyager.core.registry.screenModule | ||
import cafe.adriel.voyager.sample.multimodule.navigation.SharedScreen | ||
|
||
val featurePostsScreenModule = screenModule { | ||
register<SharedScreen.PostList> { | ||
ListScreen() | ||
} | ||
register<SharedScreen.PostDetails> { provider -> | ||
DetailsScreen(id = provider.id) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="cafe.adriel.voyager.sample.multimodule.navigation"/> |
8 changes: 8 additions & 0 deletions
8
...avigation/src/main/java/cafe/adriel/voyager/sample/multimodule/navigation/SharedScreen.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,8 @@ | ||
package cafe.adriel.voyager.sample.multimodule.navigation | ||
|
||
import cafe.adriel.voyager.core.registry.ScreenProvider | ||
|
||
sealed class SharedScreen : ScreenProvider { | ||
object PostList : SharedScreen() | ||
data class PostDetails(val id: String) : SharedScreen() | ||
} |
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...odule/shared/src/main/java/cafe/adriel/voyager/sample/multimodule/shared/SharedScreens.kt
This file was deleted.
Oops, something went wrong.
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
6 changes: 6 additions & 0 deletions
6
voyager-core/src/main/java/cafe/adriel/voyager/core/registry/ScreenModule.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,6 @@ | ||
package cafe.adriel.voyager.core.registry | ||
|
||
private typealias ScreenModule = ScreenRegistry.() -> Unit | ||
|
||
public fun screenModule(block: ScreenModule): ScreenModule = | ||
{ block() } |
Oops, something went wrong.