tauri-apps / wry

Cross-platform WebView library in Rust for Tauri.
Apache License 2.0
3.65k stars 277 forks source link

Change android_binding to not take in the path as an arg #1380

Open jkelleyrtp opened 2 weeks ago

jkelleyrtp commented 2 weeks ago

Is your feature request related to a problem? Please describe.

Right now the android_binding code is defined like so:

  ($domain:ident, $package:ident, $activity:ident, $setup:path, $main:ident, $tao:path) => {{
    use $tao::{platform::android::prelude::android_fn, platform::android::prelude::*};
    fn _____tao_store_package_name__() {
      PACKAGE.get_or_init(move || generate_package_name!($domain, $package));
    }

This forces you to pass in something like com_example as an arg. I think you can work around this by calling the binding methods manually, but it'd be much nicer to just set the com_example/wrytest manually in a static such that this binding can be hidden.

        tao::android_binding!(
            com_example,
            wrytest,
            WryActivity,
            wry::android_setup,
            _start_app,
            tao
        );
        wry::android_binding!(com_example, wrytest, wry);
amrbashir commented 1 week ago

What would the ideal use case look like for you?