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

Add BackHandler support on Android #1489

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

veyndan
Copy link
Contributor

@veyndan veyndan commented Sep 18, 2023

Closes #324.

@@ -92,3 +96,6 @@ public fun <A : AppService> TreehouseContent(
treehouseView.children.render()
}
}

@Composable
internal expect fun platformOnBackPressedDispatcher(): OnBackPressedDispatcher
Copy link
Contributor Author

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.

@veyndan veyndan force-pushed the veyndan/2023-09-14/backhandler branch from 1112de5 to 54232e8 Compare September 18, 2023 16:40
@veyndan veyndan force-pushed the veyndan/2023-09-14/backhandler branch from 54232e8 to 55e13f0 Compare September 18, 2023 16:42

/** Redwood's [OnBackPressedCallback] but implementing [ZiplineService]. */
@ObjCName("OnBackPressedCallbackService", exact = true)
public interface OnBackPressedCallbackService : ZiplineService {
Copy link
Collaborator

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?

Copy link
Contributor Author

@veyndan veyndan Sep 19, 2023

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).

@veyndan veyndan merged commit ff96a83 into trunk Sep 19, 2023
8 checks passed
@veyndan veyndan deleted the veyndan/2023-09-14/backhandler branch September 19, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BackHandler Composable
2 participants