-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from hotwired/navigator-ready-fixes
Fix crash/timing issues when the `Activity` is recreated
- Loading branch information
Showing
14 changed files
with
128 additions
and
43 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
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
26 changes: 26 additions & 0 deletions
26
navigation-fragments/src/main/java/dev/hotwire/navigation/navigator/NavigatorArguments.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,26 @@ | ||
package dev.hotwire.navigation.navigator | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Bundle | ||
import dev.hotwire.core.turbo.nav.PresentationContext | ||
import dev.hotwire.navigation.logging.logError | ||
import kotlin.text.uppercase | ||
|
||
internal const val ARG_LOCATION = "location" | ||
internal const val ARG_NAVIGATOR_NAME = "navigator-name" | ||
internal const val ARG_PRESENTATION_CONTEXT = "presentation-context" | ||
|
||
internal val Bundle.location | ||
get() = getString(ARG_LOCATION) | ||
|
||
internal val Bundle.navigatorName | ||
get() = getString(ARG_NAVIGATOR_NAME) | ||
|
||
internal val Bundle.presentationContext | ||
@SuppressLint("DefaultLocale") get() = try { | ||
val value = getString(ARG_PRESENTATION_CONTEXT) ?: "default" | ||
PresentationContext.valueOf(value.uppercase()) | ||
} catch (e: IllegalArgumentException) { | ||
logError("unknownPresentationContext", e) | ||
PresentationContext.DEFAULT | ||
} |
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.