diff --git a/build.gradle b/build.gradle
index 2687053f5..919b0060f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,13 +3,16 @@
buildscript {
ext.kotlin_version = '1.4.10'
+ ext.latestAboutLibsRelease = "8.4.3"
repositories {
google()
jcenter()
+ mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:${latestAboutLibsRelease}"
}
}
plugins {
diff --git a/src/xrt/targets/openxr_android/build.gradle b/src/xrt/targets/openxr_android/build.gradle
index 54b09ce6f..25d346c10 100644
--- a/src/xrt/targets/openxr_android/build.gradle
+++ b/src/xrt/targets/openxr_android/build.gradle
@@ -3,11 +3,19 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
+apply plugin: 'com.mikepenz.aboutlibraries.plugin'
androidGitVersion {
tagPattern(/^v[0-9]+.*/)
codeFormat = 'MNNPPPBBB'
}
+
+def parseOpenXRVersion(def fn) {
+ def matches = file(fn).readLines().find { it.contains('XR_CURRENT_API_VERSION') } =~ ~/XR_MAKE_VERSION\(([^\)]+)\)/
+ def components = matches[0][1].split(',').each { it.replace(' ', '').trim() }
+ String.join('.', components)
+}
+
android {
compileSdkVersion project.sharedTargetSdk
buildToolsVersion '30.0.2'
@@ -24,6 +32,9 @@ android {
resValue "string", "monado_lib_version", "${versionName}"
resValue "string", "app_name", "Monado XR"
+
+ resValue "string", "library_openxrheaders_libraryVersion", parseOpenXRVersion("../../../external/openxr_includes/openxr/openxr.h")
+
externalNativeBuild {
cmake {
arguments "-DEIGEN3_INCLUDE_DIR=${project.eigenIncludeDir}", "-DANDROID_PLATFORM=26", "-DANDROID_STL=c++_shared", "-DANDROID_ARM_NEON=TRUE"
@@ -34,7 +45,8 @@ android {
buildTypes {
release {
minifyEnabled false
- // proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ // Gradle plugin produces proguard-android-optimize.txt from @Keep annotations
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
@@ -65,10 +77,20 @@ android {
}
}
+aboutLibraries {
+ configPath = "config"
+}
+
dependencies {
outOfProcessImplementation project(':src:xrt:ipc:android')
implementation project(':src:xrt:auxiliary:android')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+ implementation "com.mikepenz:aboutlibraries-core:${latestAboutLibsRelease}"
+ implementation "com.mikepenz:aboutlibraries:${latestAboutLibsRelease}"
+ implementation "androidx.cardview:cardview:1.*.*"
+ implementation "androidx.recyclerview:recyclerview:1.1.*"
+ implementation "com.google.android.material:material:1.1.*"
+
}
diff --git a/src/xrt/targets/openxr_android/proguard-rules.pro b/src/xrt/targets/openxr_android/proguard-rules.pro
new file mode 100644
index 000000000..047dbd573
--- /dev/null
+++ b/src/xrt/targets/openxr_android/proguard-rules.pro
@@ -0,0 +1,10 @@
+# Copyright 2020, Collabora, Ltd.
+# SPDX-License-Identifier: BSL-1.0
+# see http://developer.android.com/guide/developing/tools/proguard.html
+# Trying to keep most of them in source code annotations and let Gradle do the work
+
+# For library auto-detection in AboutLibraries
+-keep class .R
+-keep class **.R$* {
+ ;
+}
diff --git a/src/xrt/targets/openxr_android/src/main/java/org/freedesktop/monado/openxr_runtime/MainActivity.java b/src/xrt/targets/openxr_android/src/main/java/org/freedesktop/monado/openxr_runtime/MainActivity.java
index 82195ee32..3eddd358e 100644
--- a/src/xrt/targets/openxr_android/src/main/java/org/freedesktop/monado/openxr_runtime/MainActivity.java
+++ b/src/xrt/targets/openxr_android/src/main/java/org/freedesktop/monado/openxr_runtime/MainActivity.java
@@ -13,9 +13,12 @@ import android.text.method.LinkMovementMethod;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
+import com.mikepenz.aboutlibraries.LibsBuilder;
+
public class MainActivity extends AppCompatActivity {
@Override
@@ -32,6 +35,20 @@ public class MainActivity extends AppCompatActivity {
int status = VrModeStatus.detectStatus(this, BuildConfig.APPLICATION_ID);
VrModeStatus statusFrag = VrModeStatus.newInstance(status);
fragmentTransaction.add(R.id.statusFrame, statusFrag, null);
+
+
+ Fragment libsFragment = (new LibsBuilder())
+ .withFields(R.string.class.getFields())
+
+ // We do this ourselves bigger
+ .withAboutIconShown(false)
+ // Let the fragment show our version
+ .withAboutVersionShown(true)
+
+ // Not sure why you'd do this without license info
+ .withLicenseShown(true)
+ .supportFragment();
+ fragmentTransaction.add(R.id.aboutFrame, libsFragment, null);
fragmentTransaction.commit();
}
}
diff --git a/src/xrt/targets/openxr_android/src/main/res/layout/activity_main.xml b/src/xrt/targets/openxr_android/src/main/res/layout/activity_main.xml
index 2b78955f2..96a4cd4a5 100644
--- a/src/xrt/targets/openxr_android/src/main/res/layout/activity_main.xml
+++ b/src/xrt/targets/openxr_android/src/main/res/layout/activity_main.xml
@@ -14,7 +14,7 @@
android:id="@+id/imageView"
android:layout_width="@android:dimen/thumbnail_width"
android:layout_height="@android:dimen/thumbnail_height"
- android:layout_marginTop="24dp"
+ android:layout_marginTop="8dp"
android:contentDescription="@string/monado_logo"
android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent"
@@ -39,12 +39,12 @@
android:id="@+id/textPowered"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginTop="252dp"
+ android:layout_marginTop="8dp"
android:text="@string/powered_by_monado"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ app:layout_constraintTop_toBottomOf="@+id/textView" />
+
+
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/layout/fragment_vr_mode_status.xml b/src/xrt/targets/openxr_android/src/main/res/layout/fragment_vr_mode_status.xml
index 70e006435..da66099f5 100644
--- a/src/xrt/targets/openxr_android/src/main/res/layout/fragment_vr_mode_status.xml
+++ b/src/xrt/targets/openxr_android/src/main/res/layout/fragment_vr_mode_status.xml
@@ -12,17 +12,15 @@
+ android:layout_height="wrap_content">
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute, execute,
+and transmit the Software, and to prepare derivative works of the Software,
+and to permit third-parties to whom the Software is furnished to do so, all
+subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer, must
+be included in all copies of the Software, in whole or in part, and all derivative
+works of the Software, unless such copies or derivative works are solely in
+the form of machine-executable object code generated by a source language
+processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
+OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_cjson_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_cjson_strings.xml
new file mode 100644
index 000000000..6273ee309
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_cjson_strings.xml
@@ -0,0 +1,19 @@
+
+
+
+ type
+ Dave Gamble and cJSON contributors
+ https://github.com/DaveGamble/cJSON
+ cJSON
+ cJSON is a parser that tries to share the same philosophy as JSON itself. Simple, dumb, out of the way.
+ 1.7.12
+ mit
+ true
+ https://github.com/DaveGamble/cJSON
+ native
+
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_flexkalman_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_flexkalman_strings.xml
new file mode 100644
index 000000000..d6bba4667
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_flexkalman_strings.xml
@@ -0,0 +1,18 @@
+
+
+
+ type
+ Sensics and Collabora, Ltd.
+ https://github.com/rpavlik/UVBI-and-KalmanFramework-Standalone
+ flexkalman
+ Flexible Kalman filter framework.
+ apache_2_0
+ true
+ https://github.com/rpavlik/UVBI-and-KalmanFramework-Standalone
+ native
+
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_jnipp_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_jnipp_strings.xml
new file mode 100644
index 000000000..8bafd27db
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_jnipp_strings.xml
@@ -0,0 +1,17 @@
+
+
+
+ type
+ Mitchell Dowd, Ryan Pavlik
+ https://github.com/rpavlik/jnipp
+ JNIPP
+ C++ wrapper for the Java Native Interface
+ mit
+ true
+ https://github.com/rpavlik/jnipp
+ native
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_monado_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_monado_strings.xml
new file mode 100644
index 000000000..e4300f0ba
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_monado_strings.xml
@@ -0,0 +1,19 @@
+
+
+
+ type
+ Collabora, Ltd. and the Monado contributors
+ https://monado.freedesktop.org
+ Monado
+ XR runtime construction kit
+ @string/monado_lib_version
+ bsl_1_0
+ true
+ https://gitlab.freedesktop.org/monado/monado
+ native
+
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_openxrincludes_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_openxrincludes_strings.xml
new file mode 100644
index 000000000..37ad23545
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_openxrincludes_strings.xml
@@ -0,0 +1,17 @@
+
+
+
+ type
+ The Khronos Group Inc.
+ https://khronos.org/openxr
+ OpenXR Headers
+ apache_2_0,mit
+ true
+ https://github.com/KhronosGroup/OpenXR-SDK
+ native
+
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_openxrloaderinterfaces_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_openxrloaderinterfaces_strings.xml
new file mode 100644
index 000000000..57a1ed98a
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_openxrloaderinterfaces_strings.xml
@@ -0,0 +1,17 @@
+
+
+
+ type
+ The Khronos Group Inc., Valve Corporation, LunarG, Inc.
+ https://khronos.org/openxr
+ OpenXR Loader Interfaces
+ apache_2_0
+ 1.0
+ true
+ https://github.com/KhronosGroup/OpenXR-SDK
+ native
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/library_quatexpmap_strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/library_quatexpmap_strings.xml
new file mode 100644
index 000000000..4f18c14b8
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/library_quatexpmap_strings.xml
@@ -0,0 +1,15 @@
+
+
+
+ type
+ Sensics, Inc., Collabora, Ltd.
+ Quaternion Exponential Map
+ apache_2_0
+ true
+ https://gitlab.freedesktop.org/monado/monado/-/blob/master/src/xrt/auxiliary/math/m_quatexpmap.cpp
+ native
+
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/license_bsl_1_0.xml b/src/xrt/targets/openxr_android/src/main/res/values/license_bsl_1_0.xml
new file mode 100644
index 000000000..94f24bec9
--- /dev/null
+++ b/src/xrt/targets/openxr_android/src/main/res/values/license_bsl_1_0.xml
@@ -0,0 +1,37 @@
+
+
+
+
+ Boost Software License 1.0
+ https://www.boost.org/LICENSE_1_0.txt
+
+
+ Boost Software License - Version 1.0 - August 17th, 2003
+
Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute, execute,
+and transmit the Software, and to prepare derivative works of the Software,
+and to permit third-parties to whom the Software is furnished to do so, all
+subject to the following:
+
The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer, must
+be included in all copies of the Software, in whole or in part, and all derivative
+works of the Software, unless such copies or derivative works are solely in
+the form of machine-executable object code generated by a source language
+processor.
+
+ ]]>
+
+
+ raw:bsl_1_0
+
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/strings.xml b/src/xrt/targets/openxr_android/src/main/res/values/strings.xml
index 0be4a1772..8e3aaea88 100644
--- a/src/xrt/targets/openxr_android/src/main/res/values/strings.xml
+++ b/src/xrt/targets/openxr_android/src/main/res/values/strings.xml
@@ -6,7 +6,6 @@
- "NOTICE text goes here\n\n\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam bibendum enim urna, consectetur mattis urna consectetur et. Aliquam erat volutpat. Nam dictum mi ac metus ullamcorper, eu finibus diam porta. Sed semper arcu mauris, eu porttitor arcu aliquet a. Donec et mauris id nulla aliquet eleifend. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque elementum velit non sem rutrum euismod.\n\nFusce venenatis justo ut suscipit sodales. Nunc tempor nunc nec est rhoncus varius. Quisque eget posuere sem, ac euismod nibh. Mauris viverra nisi varius varius hendrerit. Donec nibh est, ornare et ante eu, ultricies aliquet dolor. Nam laoreet velit tellus. In non felis sit amet velit mattis porttitor. Pellentesque non quam non erat porta auctor ut eget justo. Praesent non sem vitae metus blandit lacinia fringilla id mauris. Fusce quam magna, sodales eu tincidunt quis, accumsan et purus. Integer ipsum quam, egestas in malesuada id, gravida sed justo. Sed at leo tempus, porta turpis id, hendrerit dui. Nunc lobortis tortor ac orci vehicula, in sollicitudin ex pellentesque. Praesent euismod vulputate felis sed consectetur. Ut vitae quam velit.\n\nQuisque sodales sem nunc, sed semper ligula gravida ac. Nulla sit amet justo et enim suscipit lacinia ut vitae quam. Duis magna ipsum, gravida et eros a, vehicula viverra nibh. Fusce eu nisl ut massa congue auctor. Duis metus neque, egestas in accumsan scelerisque, rutrum efficitur libero. Sed bibendum id ante at pellentesque. Cras eget velit eu diam lacinia fringilla. Proin eleifend sit amet orci ac congue. Proin sed consequat justo. Sed et posuere velit.\n\nMauris consequat dignissim dui, nec ultrices augue elementum nec. Cras feugiat, ante non fringilla rhoncus, dolor metus volutpat eros, at rhoncus purus libero et mi. Sed rutrum iaculis nibh finibus congue. Maecenas sed mi vel orci volutpat sodales. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Duis non tortor aliquam felis mattis ultricies. Etiam iaculis massa id lacus dapibus placerat. Praesent ullamcorper imperdiet risus et commodo.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent scelerisque tellus purus, vel placerat sem fringilla in. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque lobortis mi nec luctus ullamcorper. Praesent diam tortor, accumsan ut vulputate non, volutpat eget ipsum. Sed sit amet ligula dictum, mollis lorem at, venenatis enim. Nullam mi nisl, pharetra suscipit facilisis non, posuere in nunc. Aliquam augue libero, eleifend non sagittis a, varius et arcu. Quisque arcu velit, lobortis eu felis ut, facilisis maximus urna. Integer nisl nisi, interdum sit amet ante nec, laoreet ullamcorper lacus. Donec lobortis non orci ac scelerisque. "An XR Runtime, powered by Monado
diff --git a/src/xrt/targets/openxr_android/src/main/res/values/styles.xml b/src/xrt/targets/openxr_android/src/main/res/values/styles.xml
index 022621d7e..5f1ba526d 100644
--- a/src/xrt/targets/openxr_android/src/main/res/values/styles.xml
+++ b/src/xrt/targets/openxr_android/src/main/res/values/styles.xml
@@ -5,7 +5,7 @@
-->
-