Skip to content

Exposing the existing AndroidApp in the public API #3818

@mwcampbell

Description

@mwcampbell

For my work on accesskit_winit, it would be helpful if winit exposed the existing AndroidApp instance in the public API, e.g. through an android_app method on ActiveEventLoopExtAndroid.

It's true that the top-level application already has the AndroidApp instance, since it has to pass that to winit in the first place. But that's not enough for accesskit_winit, for two reasons:

  1. Directly passing the AndroidApp instance from the application to accesskit_winit would require accesskit_winit to have a platform-specific adapter constructor for Android, and I'm trying to avoid platform-specific things in the accesskit_winit API, since the point of winit is to be cross-platform.
  2. Having the application directly pass the AndroidApp instance to accesskit_winit would also break the layering that tends to happen in non-trivial applications. Consider that accesskit_winit::Adapter is typically instantiated by a cross-platform framework like eframe or masonry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DS - androidAffects the Android backend

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions