Inject Android bridge into legacy platform services
This commit is contained in:
@@ -1093,6 +1093,24 @@ void android_main(struct android_app* state) {
|
||||
// DON'T REMOVE, even if the compiler say it's deprecated
|
||||
app_dummy();
|
||||
auto platform_services = pp::platform::legacy::create_platform_services({
|
||||
.android_bridge = {
|
||||
.clipboard_text = [] { return android_get_clipboard(); },
|
||||
.set_clipboard_text = [](std::string_view text) {
|
||||
return android_set_clipboard(std::string(text));
|
||||
},
|
||||
.set_virtual_keyboard_visible = [](bool visible) { displayKeyboard(visible); },
|
||||
.attach_ui_thread = [] { android_attach_jni(); },
|
||||
.detach_ui_thread = [] { android_detach_jni(); },
|
||||
.acquire_render_context = [] { android_async_lock(); },
|
||||
.release_render_context = [] { android_async_unlock(); },
|
||||
.present_render_context = [] { android_async_swap(); },
|
||||
.pick_file = [](pp::platform::PickedPathCallback callback) {
|
||||
android_pick_file(std::move(callback));
|
||||
},
|
||||
.pick_save_file = [](pp::platform::PickedPathCallback callback) {
|
||||
android_pick_file_save(std::move(callback));
|
||||
},
|
||||
},
|
||||
.android_storage_paths = g_android_storage_paths,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user