Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open fun in open class Router #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions library/src/main/kotlin/com/github/terrakok/cicerone/Router.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ open class Router : BaseRouter() {
* @param clearContainer if FALSE then new screen shows over previous
*/
@JvmOverloads
fun navigateTo(screen: Screen, clearContainer: Boolean = true) {
open fun navigateTo(screen: Screen, clearContainer: Boolean = true) {
executeCommands(Forward(screen, clearContainer))
}

Expand All @@ -24,7 +24,7 @@ open class Router : BaseRouter() {
*
* @param screen screen
*/
fun newRootScreen(screen: Screen) {
open fun newRootScreen(screen: Screen) {
executeCommands(BackTo(null), Replace(screen))
}

Expand All @@ -37,7 +37,7 @@ open class Router : BaseRouter() {
*
* @param screen screen
*/
fun replaceScreen(screen: Screen) {
open fun replaceScreen(screen: Screen) {
executeCommands(Replace(screen))
}

Expand All @@ -49,7 +49,7 @@ open class Router : BaseRouter() {
*
* @param screen screen
*/
fun backTo(screen: Screen?) {
open fun backTo(screen: Screen?) {
executeCommands(BackTo(screen))
}

Expand All @@ -60,7 +60,7 @@ open class Router : BaseRouter() {
* @param showOnlyTopScreenView if FALSE then all screen views show together
*/
@JvmOverloads
fun newChain(vararg screens: Screen, showOnlyTopScreenView: Boolean = true) {
open fun newChain(vararg screens: Screen, showOnlyTopScreenView: Boolean = true) {
val commands = screens.map { Forward(it, showOnlyTopScreenView) }
executeCommands(*commands.toTypedArray())
}
Expand All @@ -72,7 +72,7 @@ open class Router : BaseRouter() {
* @param showOnlyTopScreenView if FALSE then all screen views show together
*/
@JvmOverloads
fun newRootChain(vararg screens: Screen, showOnlyTopScreenView: Boolean = true) {
open fun newRootChain(vararg screens: Screen, showOnlyTopScreenView: Boolean = true) {
val commands = screens.mapIndexed { index, screen ->
if (index == 0)
Replace(screen)
Expand All @@ -87,7 +87,7 @@ open class Router : BaseRouter() {
*
* It's mostly used to finish the application or close a supplementary navigation chain.
*/
fun finishChain() {
open fun finishChain() {
executeCommands(BackTo(null), Back())
}

Expand All @@ -97,7 +97,7 @@ open class Router : BaseRouter() {
* Behavior in the case when the current screen is the root depends on
* the processing of the [Back] command in a [Navigator] implementation.
*/
fun exit() {
open fun exit() {
executeCommands(Back())
}
}