From 368d71d6a598a61d88fa6f22819746df0da4ec18 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Wed, 6 Dec 2023 17:53:46 +0100 Subject: [PATCH] [VisionGlass] Render Wolvic in glasses and control UI on phone screen This is a large change because it's difficult to split it in smaller chunks as we're revamping the way Wolvic works in the VisionGlass. In general this is not a good idea but provided that we're in early stages of VisionGlass port this should be fine as there should not be regressions as the previous funtionality was quite limited. These are the main changes: * Wolvic is now rendered just in the external screen (the glasses) using Android's Presentation API. * The phone screen shows a different UI which consists on a quite minimalistic and simple UI that allows users to performs clicks on a touchpad and also a "back" button. Apart from that there are some other changes: * Fix a crash with early setControllerOrientation call * Enable WebXR by properly setting EyeResolution * Enable clicks on WebXR experiences * Use the actual FOV of the device * Improved the "wait for USB permissions" code --- .../main/res/layout/visionglass_layout.xml | 35 +- .../visionglass_presentation_layout.xml | 16 + app/src/visionglass/AndroidManifest.xml | 3 +- .../cpp/DeviceDelegateVisionGlass.cpp | 114 +++--- .../cpp/DeviceDelegateVisionGlass.h | 1 + app/src/visionglass/cpp/native-lib.cpp | 13 +- .../com/igalia/wolvic/PlatformActivity.java | 328 +++++++++++++----- 7 files changed, 335 insertions(+), 175 deletions(-) create mode 100644 app/src/main/res/layout/visionglass_presentation_layout.xml diff --git a/app/src/main/res/layout/visionglass_layout.xml b/app/src/main/res/layout/visionglass_layout.xml index 7f603b8c405..2bc0ec8c4da 100644 --- a/app/src/main/res/layout/visionglass_layout.xml +++ b/app/src/main/res/layout/visionglass_layout.xml @@ -1,26 +1,31 @@ - - + android:background="#333333" /> - + android:text="@string/back_button" + android:drawableStart="@drawable/ic_icon_back" + android:layout_alignParentBottom="true" + android:layout_alignParentStart="true" /> +