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

Support backstack read operations from a background thread #293

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object Versions {
const val compileSdkVersion = 30
const val minSdkVersion = 18
const val minSdkVersion = 21
const val targetSdkVersion = 30

const val kotlinVersion = "1.8.21"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.wealthfront.magellan.transitions.NoAnimationTransition
import com.wealthfront.magellan.view.whenMeasured
import java.util.ArrayDeque
import java.util.Deque
import java.util.concurrent.ConcurrentLinkedDeque

public open class NavigationDelegate(
protected val container: () -> ScreenContainer,
Expand All @@ -32,15 +33,11 @@ public open class NavigationDelegate(

protected var containerView: ScreenContainer? = null
protected val navigationPropagator: NavigationPropagator = NavigationPropagator
public val backStack: Deque<NavigationEvent> = ArrayDeque()
public val backStack: Deque<NavigationEvent> = ConcurrentLinkedDeque()

protected val Deque<NavigationEvent>.currentNavigable: NavigableCompat?
get() {
return if (isNotEmpty()) {
peek()?.navigable
} else {
null
}
return peek()?.navigable
}

protected val currentNavigable: NavigableCompat?
Expand Down