Add support for Android XR devices to the Godot XR Editor

This commit is contained in:
Fredia Huya-Kouadio
2024-12-19 12:56:17 -08:00
parent bd2ca13c6f
commit 353c871160
8 changed files with 63 additions and 20 deletions
@@ -115,6 +115,7 @@
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:process=":GodotXRGame"
android:launchMode="singleTask"
android:taskAffinity=":xr"
android:icon="@mipmap/ic_play_window"
android:label="@string/godot_game_activity_name"
android:exported="false"
@@ -69,11 +69,7 @@ import org.godotengine.godot.error.Error
import org.godotengine.godot.utils.DialogUtils
import org.godotengine.godot.utils.PermissionsUtil
import org.godotengine.godot.utils.ProcessPhoenix
import org.godotengine.godot.utils.isNativeXRDevice
import org.godotengine.godot.xr.HybridMode
import org.godotengine.godot.xr.getHybridAppLaunchMode
import org.godotengine.godot.xr.HYBRID_APP_PANEL_CATEGORY
import org.godotengine.godot.xr.HYBRID_APP_IMMERSIVE_CATEGORY
import org.godotengine.openxr.vendors.utils.*
import kotlin.math.min
/**
@@ -743,12 +739,8 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
return isNativeXRDevice(applicationContext)
}
if (featureTag == "horizonos") {
return BuildConfig.FLAVOR == "horizonos"
}
if (featureTag == "picoos") {
return BuildConfig.FLAVOR == "picoos"
if (featureTag == BuildConfig.FLAVOR) {
return true
}
return super.supportsFeature(featureTag)
@@ -38,8 +38,7 @@ import org.godotengine.godot.GodotLib
import org.godotengine.godot.editor.utils.GameMenuUtils
import org.godotengine.godot.utils.PermissionsUtil
import org.godotengine.godot.utils.ProcessPhoenix
import org.godotengine.godot.xr.HYBRID_APP_FEATURE
import org.godotengine.godot.xr.isHybridAppEnabled
import org.godotengine.openxr.vendors.utils.*
/**
* Base class for the Godot play windows.
@@ -43,11 +43,8 @@ import org.godotengine.editor.embed.GameMenuFragment
import org.godotengine.godot.GodotLib
import org.godotengine.godot.editor.utils.GameMenuUtils
import org.godotengine.godot.utils.ProcessPhoenix
import org.godotengine.godot.utils.isHorizonOSDevice
import org.godotengine.godot.utils.isNativeXRDevice
import org.godotengine.godot.xr.HYBRID_APP_PANEL_FEATURE
import org.godotengine.godot.xr.XRMode
import org.godotengine.godot.xr.isHybridAppEnabled
import org.godotengine.openxr.vendors.utils.*
/**
* Drives the 'run project' window of the Godot Editor.