From feef76cbabea4f24ffeed0c15eb5a57010d8b791 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 31 Aug 2016 11:31:07 -0700 Subject: [PATCH] add tools, no plugins, add InterfaceActivity --- CMakeLists.txt | 2 +- .../interface/InterfaceActivity.java | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 interface/src/java/io/highfidelity/interface/InterfaceActivity.java diff --git a/CMakeLists.txt b/CMakeLists.txt index f26a036397..9d9eddc0b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,7 @@ endif() if (ANDROID OR DESKTOP_GVR) add_subdirectory(interface) - add_subdirectory(plugins) + add_subdirectory(tools) add_subdirectory(gvr-interface) endif () diff --git a/interface/src/java/io/highfidelity/interface/InterfaceActivity.java b/interface/src/java/io/highfidelity/interface/InterfaceActivity.java new file mode 100644 index 0000000000..c7cbdd3dff --- /dev/null +++ b/interface/src/java/io/highfidelity/interface/InterfaceActivity.java @@ -0,0 +1,41 @@ +// +// InterfaceActivity.java +// gvr-interface/java +// +// Created by Stephen Birarda on 1/26/15. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +package io.highfidelity.gvrinterface; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.WindowManager; +import android.util.Log; +import org.qtproject.qt5.android.bindings.QtActivity; + +public class InterfaceActivity extends QtActivity { + + public static native void handleHifiURL(String hifiURLString); + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + + // Get the intent that started this activity in case we have a hifi:// URL to parse + Intent intent = getIntent(); + if (intent.getAction() == Intent.ACTION_VIEW) { + Uri data = intent.getData(); + + if (data.getScheme().equals("hifi")) { + handleHifiURL(data.toString()); + } + } + + } +} \ No newline at end of file