mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
repairs for hifi scheme handling on android
This commit is contained in:
parent
b696f46d25
commit
dd4f4f0993
3 changed files with 37 additions and 36 deletions
|
@ -8,12 +8,14 @@
|
||||||
<!-- VR MODE -->
|
<!-- VR MODE -->
|
||||||
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
||||||
|
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
<activity
|
||||||
|
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||||
android:name="${ANDROID_ACTIVITY_NAME}"
|
android:name="${ANDROID_ACTIVITY_NAME}"
|
||||||
android:label="@string/AppDisplayName"
|
android:label="@string/AppDisplayName"
|
||||||
android:screenOrientation="landscape"
|
android:screenOrientation="landscape"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
${ANDROID_APK_THEME}>
|
${ANDROID_APK_THEME}>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
@ -42,9 +44,12 @@
|
||||||
|
|
||||||
<!-- Splash screen -->
|
<!-- Splash screen -->
|
||||||
<!-- <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> -->
|
<!-- <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> -->
|
||||||
|
|
||||||
|
${ANDROID_EXTRA_ACTIVITY_XML}
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="com.oculusvr.vrlib.PlatformActivity"
|
<activity
|
||||||
|
android:name="com.oculusvr.vrlib.PlatformActivity"
|
||||||
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="landscape"
|
android:screenOrientation="landscape"
|
||||||
|
@ -52,7 +57,6 @@
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
${ANDROID_EXTRA_APPLICATION_XML}
|
${ANDROID_EXTRA_APPLICATION_XML}
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
<uses-sdk android:minSdkVersion="${ANDROID_API_LEVEL}" android:targetSdkVersion="${ANDROID_API_LEVEL}"/>
|
<uses-sdk android:minSdkVersion="${ANDROID_API_LEVEL}" android:targetSdkVersion="${ANDROID_API_LEVEL}"/>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,21 @@
|
||||||
set(TARGET_NAME gvr-interface)
|
set(TARGET_NAME gvr-interface)
|
||||||
|
|
||||||
if (ANDROID)
|
if (ANDROID)
|
||||||
|
set(ANDROID_APK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk-build")
|
||||||
|
set(ANDROID_APK_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk")
|
||||||
|
|
||||||
|
set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME})
|
||||||
|
set(ANDROID_APP_DISPLAY_NAME Interface)
|
||||||
|
set(ANDROID_API_LEVEL 19)
|
||||||
|
set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
|
||||||
|
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
||||||
|
set(ANDROID_APK_VERSION_NAME "0.1")
|
||||||
|
set(ANDROID_APK_VERSION_CODE 1)
|
||||||
|
set(ANDROID_DEPLOY_QT_INSTALL "--install")
|
||||||
|
|
||||||
|
set(BUILD_SHARED_LIBS ON)
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
|
||||||
|
|
||||||
setup_hifi_library(Gui Widgets AndroidExtras)
|
setup_hifi_library(Gui Widgets AndroidExtras)
|
||||||
else ()
|
else ()
|
||||||
setup_hifi_project(Gui Widgets)
|
setup_hifi_project(Gui Widgets)
|
||||||
|
@ -13,25 +28,6 @@ include_glm()
|
||||||
link_hifi_libraries(shared networking audio-client avatars)
|
link_hifi_libraries(shared networking audio-client avatars)
|
||||||
include_dependency_includes()
|
include_dependency_includes()
|
||||||
|
|
||||||
if (ANDROID)
|
|
||||||
|
|
||||||
set(ANDROID_APK_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk-build")
|
|
||||||
set(ANDROID_APK_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/apk")
|
|
||||||
|
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
|
|
||||||
set(BUILD_SHARED_LIBS ON)
|
|
||||||
|
|
||||||
set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME})
|
|
||||||
set(ANDROID_APP_DISPLAY_NAME Interface)
|
|
||||||
set(ANDROID_API_LEVEL 19)
|
|
||||||
set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface)
|
|
||||||
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
|
||||||
set(ANDROID_APK_VERSION_NAME "0.1")
|
|
||||||
set(ANDROID_APK_VERSION_CODE 1)
|
|
||||||
set(ANDROID_DEPLOY_QT_INSTALL "--install")
|
|
||||||
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
find_package(LibOVR)
|
find_package(LibOVR)
|
||||||
if (LIBOVR_FOUND)
|
if (LIBOVR_FOUND)
|
||||||
add_definitions(-DHAVE_LIBOVR)
|
add_definitions(-DHAVE_LIBOVR)
|
||||||
|
@ -80,7 +76,8 @@ if (ANDROID)
|
||||||
\n </intent-filter>"
|
\n </intent-filter>"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(ANDROID_EXTRA_APPLICATION_XML "${HOCKEY_APP_ACTIVITY}${HIFI_URL_INTENT}")
|
set(ANDROID_EXTRA_APPLICATION_XML "${HOCKEY_APP_ACTIVITY}")
|
||||||
|
set(ANDROID_EXTRA_ACTIVITY_XML "${HIFI_URL_INTENT}")
|
||||||
|
|
||||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/hockeyapp.xml.in" "${ANDROID_APK_BUILD_DIR}/res/values/hockeyapp.xml")
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/templates/hockeyapp.xml.in" "${ANDROID_APK_BUILD_DIR}/res/values/hockeyapp.xml")
|
||||||
qt_create_apk()
|
qt_create_apk()
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef Q_OS_ANDROID
|
#ifdef Q_WS_ANDROID
|
||||||
|
|
||||||
#include <QtAndroidExtras/QAndroidJniEnvironment>
|
#include <QtAndroidExtras/QAndroidJniEnvironment>
|
||||||
#include <QtAndroidExtras/QAndroidJniObject>
|
#include <QtAndroidExtras/QAndroidJniObject>
|
||||||
|
@ -42,7 +42,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||||
|
|
||||||
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
|
connect(this, &QGuiApplication::applicationStateChanged, this, &GVRInterface::handleApplicationStateChange);
|
||||||
|
|
||||||
#if defined(Q_OS_ANDROID) && defined(HAVE_LIBOVR)
|
#if defined(Q_WS_ANDROID) && defined(HAVE_LIBOVR)
|
||||||
QAndroidJniEnvironment jniEnv;
|
QAndroidJniEnvironment jniEnv;
|
||||||
|
|
||||||
QPlatformNativeInterface* interface = QApplication::platformNativeInterface();
|
QPlatformNativeInterface* interface = QApplication::platformNativeInterface();
|
||||||
|
@ -59,7 +59,7 @@ GVRInterface::GVRInterface(int argc, char* argv[]) :
|
||||||
}
|
}
|
||||||
|
|
||||||
void GVRInterface::idle() {
|
void GVRInterface::idle() {
|
||||||
#if defined(Q_OS_ANDROID) && defined(HAVE_LIBOVR)
|
#if defined(Q_WS_ANDROID) && defined(HAVE_LIBOVR)
|
||||||
if (!_inVRMode && ovr_IsHeadsetDocked()) {
|
if (!_inVRMode && ovr_IsHeadsetDocked()) {
|
||||||
qDebug() << "The headset just got docked - assume we are in VR mode.";
|
qDebug() << "The headset just got docked - assume we are in VR mode.";
|
||||||
_inVRMode = true;
|
_inVRMode = true;
|
||||||
|
|
Loading…
Reference in a new issue