-
-
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
16 changed files
with
227 additions
and
287 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.RouteOrDirection | ||
|
||
/** | ||
* 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: RouteOrDirection, popUpToBuilder: PopUpToBuilder.() -> Unit = {}) { | ||
jetpackBuilder.popUpTo(route.route, popUpToBuilder) | ||
} | ||
} |
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
59 changes: 0 additions & 59 deletions
59
...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
24 changes: 0 additions & 24 deletions
24
...tions/src/main/java/com/ramcosta/composedestinations/testing/TestDestinationsNavigator.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.