mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-12-06 08:42:32 -08:00
Remove BVH button on android builds (#1478)
This commit is contained in:
1 parent
5a7a650f83
commit
add1e4eb5d
4 files changed
+17
-3
No files matched your search
@@ -56,7 +56,7 @@ export function WidgetsComponent() {
|
||||
<ResetButton type={ResetType.Full} size="big"></ResetButton>
|
||||
<ResetButton type={ResetType.Mounting} size="big"></ResetButton>
|
||||
<ClearMountingButton></ClearMountingButton>
|
||||
<BVHButton></BVHButton>
|
||||
{!__ANDROID__?.isThere() && <BVHButton></BVHButton>}
|
||||
<TrackingPauseButton></TrackingPauseButton>
|
||||
</div>
|
||||
<div className="w-full">
|
||||
|
||||
Vendored
+5
@@ -4,6 +4,11 @@
|
||||
declare const __COMMIT_HASH__: string;
|
||||
declare const __VERSION_TAG__: string;
|
||||
declare const __GIT_CLEAN__: boolean;
|
||||
declare const __ANDROID__:
|
||||
| {
|
||||
isThere: () => boolean;
|
||||
}
|
||||
| undefined;
|
||||
|
||||
interface Window {
|
||||
readonly isTauri: boolean;
|
||||
|
||||
@@ -112,7 +112,7 @@ android {
|
||||
defaultConfig {
|
||||
|
||||
// Uniquely identifies the package for publishing.
|
||||
applicationId = "dev.slimevr.server"
|
||||
applicationId = "dev.slimevr.server.android"
|
||||
|
||||
// Defines the minimum API level required to run the app.
|
||||
minSdk = 26
|
||||
|
||||
@@ -2,11 +2,17 @@ package dev.slimevr.android
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.webkit.JavascriptInterface
|
||||
import android.webkit.WebSettings
|
||||
import android.webkit.WebView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import io.eiren.util.logging.LogManager
|
||||
|
||||
class AndroidJsObject {
|
||||
@JavascriptInterface
|
||||
fun isThere(): Boolean = true
|
||||
}
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -39,13 +45,16 @@ class MainActivity : AppCompatActivity() {
|
||||
guiWebView.settings.javaScriptEnabled = true
|
||||
guiWebView.settings.domStorageEnabled = true
|
||||
|
||||
// TODO: Let code know it is in android, should be gone when we start using tauri
|
||||
guiWebView.addJavascriptInterface(AndroidJsObject(), "__ANDROID__")
|
||||
|
||||
// Try fixing zoom usability
|
||||
guiWebView.settings.setSupportZoom(true)
|
||||
guiWebView.settings.useWideViewPort = true
|
||||
guiWebView.settings.loadWithOverviewMode = true
|
||||
guiWebView.invokeZoomPicker()
|
||||
|
||||
// Disable cache! This is all local anyways
|
||||
// Disable cache! This is all local anyway
|
||||
guiWebView.settings.cacheMode = WebSettings.LOAD_NO_CACHE
|
||||
guiWebView.clearCache(true)
|
||||
|
||||
|
||||
Reference in new issue
Block a user