-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Showing
8 changed files
with
68 additions
and
80 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
35 changes: 35 additions & 0 deletions
35
voyager-navigator/src/commonMain/kotlin/cafe/adriel/voyager/navigator/NavigatorCreator.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,35 @@ | ||
package cafe.adriel.voyager.navigator | ||
|
||
import androidx.compose.runtime.saveable.SaveableStateHolder | ||
import cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi | ||
import cafe.adriel.voyager.core.screen.Screen | ||
|
||
public typealias NavigatorCreator = ( | ||
screens: List<Screen>, | ||
key: String, | ||
stateHolder: SaveableStateHolder, | ||
disposeBehavior: NavigatorDisposeBehavior, | ||
parent: Navigator? | ||
) -> Navigator | ||
|
||
// Choose your Navigator | ||
public fun summonNavigatorCreator(): NavigatorCreator = DefaultNavigatorCreator() | ||
|
||
private fun DefaultNavigatorCreator(): NavigatorCreator = { | ||
screenCollection: List<Screen>, | ||
s: String, | ||
saveableStateHolder: SaveableStateHolder, | ||
navigatorDisposeBehavior: NavigatorDisposeBehavior, | ||
navigator: Navigator?, -> | ||
DefaultNavigator(screenCollection, s, saveableStateHolder, navigatorDisposeBehavior, navigator) | ||
} | ||
|
||
@ExperimentalVoyagerApi | ||
private fun ExtendedNavigatorCreator(): NavigatorCreator = { | ||
screenCollection: List<Screen>, | ||
s: String, | ||
saveableStateHolder: SaveableStateHolder, | ||
navigatorDisposeBehavior: NavigatorDisposeBehavior, | ||
navigator: Navigator?, -> | ||
ExtendedNavigator(screenCollection, s, saveableStateHolder, navigatorDisposeBehavior, navigator) | ||
} |
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
30 changes: 0 additions & 30 deletions
30
...navigator/src/commonMain/kotlin/cafe/adriel/voyager/navigator/tab/TabNavigatorExtended.kt
This file was deleted.
Oops, something went wrong.