From 92b1d87911cdef48f3189b5de9586f31689ba310 Mon Sep 17 00:00:00 2001 From: Marek Pszczolka Date: Sun, 28 Jan 2024 21:26:43 +0100 Subject: [PATCH 1/3] Fix canHandeBackPress typo --- .../bumble/appyx/interactions/core/model/AppyxComponent.kt | 2 +- .../appyx/interactions/core/model/BaseAppyxComponent.kt | 2 +- .../appyx/interactions/core/model/CombinedAppyxComponent.kt | 6 +++--- .../appyx/interactions/core/model/EmptyAppyxComponent.kt | 2 +- .../appyx/interactions/permanent/PermanentAppyxComponent.kt | 2 +- .../kotlin/com/bumble/appyx/navigation/node/Node.kt | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/AppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/AppyxComponent.kt index 7f26c3ffb..df896b751 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/AppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/AppyxComponent.kt @@ -26,7 +26,7 @@ interface AppyxComponent : SavesInsta fun onRemovedFromComposition() - fun canHandeBackPress(): StateFlow + fun canHandleBackPress(): StateFlow fun handleBackPress(): Boolean diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt index 0ef3488e6..ff00363e1 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/BaseAppyxComponent.kt @@ -286,7 +286,7 @@ open class BaseAppyxComponent( override fun handleBackPress(): Boolean = backPressStrategy.handleBackPress() - override fun canHandeBackPress(): StateFlow = backPressStrategy.canHandleBackPress + override fun canHandleBackPress(): StateFlow = backPressStrategy.canHandleBackPress override fun saveInstanceState(state: MutableSavedStateMap) { model.saveInstanceState(state) diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/CombinedAppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/CombinedAppyxComponent.kt index c4899810c..e442ca76b 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/CombinedAppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/CombinedAppyxComponent.kt @@ -34,14 +34,14 @@ class CombinedAppyxComponent( override fun handleBackPress(): Boolean { appyxComponents.forEach { appyxComponent -> - if (appyxComponent.canHandeBackPress().value) + if (appyxComponent.canHandleBackPress().value) return appyxComponent.handleBackPress() } return false } - override fun canHandeBackPress(): StateFlow = - combineState(appyxComponents.map { it.canHandeBackPress() }, scope) { array -> + override fun canHandleBackPress(): StateFlow = + combineState(appyxComponents.map { it.canHandleBackPress() }, scope) { array -> array.any { it } } diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/EmptyAppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/EmptyAppyxComponent.kt index 6f20dfb7a..04914f048 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/EmptyAppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/core/model/EmptyAppyxComponent.kt @@ -13,7 +13,7 @@ class EmptyAppyxComponent : AppyxComponent = MutableStateFlow(false) + override fun canHandleBackPress(): StateFlow = MutableStateFlow(false) override fun handleBackPress(): Boolean = false diff --git a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/permanent/PermanentAppyxComponent.kt b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/permanent/PermanentAppyxComponent.kt index 664407e02..1dcef6afa 100644 --- a/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/permanent/PermanentAppyxComponent.kt +++ b/appyx-interactions/common/src/commonMain/kotlin/com/bumble/appyx/interactions/permanent/PermanentAppyxComponent.kt @@ -47,7 +47,7 @@ class PermanentAppyxComponent( instant.operation(operation) } - override fun canHandeBackPress(): StateFlow = MutableStateFlow(false) + override fun canHandleBackPress(): StateFlow = MutableStateFlow(false) override fun handleBackPress(): Boolean = false diff --git a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt index 5dbe2409f..df7229a3d 100644 --- a/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt +++ b/appyx-navigation/common/src/commonMain/kotlin/com/bumble/appyx/navigation/node/Node.kt @@ -206,7 +206,7 @@ abstract class Node( private fun BackHandler() { //todo support delegating to plugins val canHandleBack = appyxComponent - .canHandeBackPress() + .canHandleBackPress() .collectAsState(initial = false) PlatformBackHandler(enabled = canHandleBack.value) { appyxComponent.handleBackPress() From fbf9d91c6f5effccd55a36f54fc924bc75e8270d Mon Sep 17 00:00:00 2001 From: Marek Pszczolka Date: Sun, 28 Jan 2024 22:07:35 +0100 Subject: [PATCH 2/3] Update docs about canHandeBackPress typo fix --- CHANGELOG.md | 1 + documentation/releases/2.0.0-alpha10.md | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d99a74c..3689161d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Please refer to [2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md) - [#654](https://github.com/bumble-tech/appyx/pull/654) - Renamings - [#657](https://github.com/bumble-tech/appyx/pull/657) - Rename ParentNode & Node to Node and LeafNode - [#644](https://github.com/bumble-tech/appyx/pull/644) – Refactor AppyxComponent and application of draggable modifier +- [#673](https://github.com/bumble-tech/appyx/pull/673) – Fixed typo canHandeBackPress->canHandleBackPress ### Fixed diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 201af6577..7f1e85e50 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -156,6 +156,15 @@ class YourNode( } ``` +## Fixed typo `canHandeBackPress` + +```diff +interface AppyxComponent /*...*/ { + /*...*/ +- fun canHandeBackPress(): StateFlow ++ fun canHandleBackPress(): StateFlow +``` +   # Changes unlikely to affect you directly From 21c149dd1f3e64dc67f77e676a45f260cc97242d Mon Sep 17 00:00:00 2001 From: Marek Pszczolka Date: Sat, 3 Feb 2024 16:32:06 +0100 Subject: [PATCH 3/3] Improve documentation for canHandeBackPress typo fix --- CHANGELOG.md | 2 +- documentation/releases/2.0.0-alpha10.md | 9 --------- documentation/releases/2.0.0-alpha11.md | 14 ++++++++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 documentation/releases/2.0.0-alpha11.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bb10d681..7c4f5401d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Pending changes - [#670](https://github.com/bumble-tech/appyx/pull/670) - Fixes ios lifecycle +- [#673](https://github.com/bumble-tech/appyx/pull/673) – Fix canHandeBackPress typo --- @@ -24,7 +25,6 @@ Please refer to [2.0.0-alpha10 – Migration guide](2.0.0-alpha10.md) - [#654](https://github.com/bumble-tech/appyx/pull/654) - Renamings - [#657](https://github.com/bumble-tech/appyx/pull/657) - Rename ParentNode & Node to Node and LeafNode - [#644](https://github.com/bumble-tech/appyx/pull/644) – Refactor AppyxComponent and application of draggable modifier -- [#673](https://github.com/bumble-tech/appyx/pull/673) – Fixed typo canHandeBackPress->canHandleBackPress ### Fixed diff --git a/documentation/releases/2.0.0-alpha10.md b/documentation/releases/2.0.0-alpha10.md index 7f1e85e50..201af6577 100644 --- a/documentation/releases/2.0.0-alpha10.md +++ b/documentation/releases/2.0.0-alpha10.md @@ -156,15 +156,6 @@ class YourNode( } ``` -## Fixed typo `canHandeBackPress` - -```diff -interface AppyxComponent /*...*/ { - /*...*/ -- fun canHandeBackPress(): StateFlow -+ fun canHandleBackPress(): StateFlow -``` -   # Changes unlikely to affect you directly diff --git a/documentation/releases/2.0.0-alpha11.md b/documentation/releases/2.0.0-alpha11.md new file mode 100644 index 000000000..002a45105 --- /dev/null +++ b/documentation/releases/2.0.0-alpha11.md @@ -0,0 +1,14 @@ +--- +title: 2.0.0-alpha11 – Migration guide +--- + +# 2.0.0-alpha11 – Migration guide + +## Fixed `canHandeBackPress` typo + +```diff +interface AppyxComponent /*...*/ { + /*...*/ +- fun canHandeBackPress(): StateFlow ++ fun canHandleBackPress(): StateFlow +``` \ No newline at end of file