-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add BackHandler
support on Android
#1489
Conversation
@@ -92,3 +96,6 @@ public fun <A : AppService> TreehouseContent( | |||
treehouseView.children.render() | |||
} | |||
} | |||
|
|||
@Composable | |||
internal expect fun platformOnBackPressedDispatcher(): OnBackPressedDispatcher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function and its actual
definitions are identical to that of RedwoodContent
. When TreehouseContent
is a wrapper around RedwoodContent
, this function and its actual
's can be removed.
1112de5
to
54232e8
Compare
54232e8
to
55e13f0
Compare
redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/BackHandler.kt
Show resolved
Hide resolved
redwood-compose/src/commonMain/kotlin/app/cash/redwood/compose/BackHandler.kt
Show resolved
Hide resolved
...-treehouse-host/src/androidUnitTest/kotlin/app/cash/redwood/treehouse/TreehouseLayoutTest.kt
Show resolved
Hide resolved
|
||
/** Redwood's [OnBackPressedCallback] but implementing [ZiplineService]. */ | ||
@ObjCName("OnBackPressedCallbackService", exact = true) | ||
public interface OnBackPressedCallbackService : ZiplineService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't this one extend OnBackPressedCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnBackPressedCallback
is an abstract class
, so I can only extend it by making OnBackPressedCallbackService
an abstract class
. Per the ZiplineService
KDoc, ZiplineService
should be implemented by interfaces (i.e., not abstract classes).
Closes #324.