-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix shadowed extension functions of NavController pt2
- Loading branch information
Showing
15 changed files
with
203 additions
and
258 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
48 changes: 48 additions & 0 deletions
48
...rc/main/java/com/ramcosta/composedestinations/navigation/DestinationsNavOptionsBuilder.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,48 @@ | ||
package com.ramcosta.composedestinations.navigation | ||
|
||
import androidx.navigation.NavOptionsBuilder | ||
import androidx.navigation.PopUpToBuilder | ||
import com.ramcosta.composedestinations.spec.Route | ||
|
||
/** | ||
* Like [NavOptionsBuilder] but has Compose Destinations friendly | ||
* version of its APIs. | ||
*/ | ||
class DestinationsNavOptionsBuilder( | ||
private val jetpackBuilder: NavOptionsBuilder | ||
) { | ||
|
||
/** | ||
* @see [NavOptionsBuilder.launchSingleTop] | ||
*/ | ||
var launchSingleTop | ||
get() = jetpackBuilder.launchSingleTop | ||
set(value) { | ||
jetpackBuilder.launchSingleTop = value | ||
} | ||
|
||
/** | ||
* @see [NavOptionsBuilder.restoreState] | ||
*/ | ||
var restoreState | ||
get() = jetpackBuilder.restoreState | ||
set(value) { | ||
jetpackBuilder.restoreState = value | ||
} | ||
|
||
/** | ||
* @see [NavOptionsBuilder.popUpToRoute] | ||
*/ | ||
val popUpToRoute: String? | ||
get() = jetpackBuilder.popUpToRoute | ||
|
||
/** | ||
* Like [NavOptionsBuilder.popUpTo] but accepting a [com.ramcosta.composedestinations.spec.Route] | ||
* or [com.ramcosta.composedestinations.spec.Direction] to pop up to. | ||
* | ||
* @see [NavOptionsBuilder.popUpTo] | ||
*/ | ||
fun popUpTo(route: Route, popUpToBuilder: PopUpToBuilder.() -> Unit = {}) { | ||
jetpackBuilder.popUpTo(route.route, popUpToBuilder) | ||
} | ||
} |
62 changes: 0 additions & 62 deletions
62
...estinations/src/main/java/com/ramcosta/composedestinations/navigation/NavControllerExt.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
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
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
Oops, something went wrong.