Skip to content

Commit

Permalink
Fix hybrid app support for recent Godot Android library changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsnopek committed Feb 7, 2025
1 parent dabe6c7 commit c54837b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ class GodotOpenXRHybridAppInternal(godot: Godot?) : GodotPlugin(godot) {
fun hybridAppSwitchTo(mode: Int, data: String = ""): Boolean {
if (hybridMode == mode) return false

if (!isNativeXRDevice()) return false

val context = getActivity() ?: return false

if (!isNativeXRDevice(context)) return false

val activityName = if (mode == IMMERSIVE_MODE) IMMERSIVE_ACTIVITY else PANEL_ACTIVITY
val newInstance = Intent()
.setComponent(ComponentName(context, activityName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ class GodotPanelApp : GodotActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
installSplashScreen()
super.onCreate(savedInstanceState)
}

override fun getCommandLine(): MutableList<String> {
// Force XR to be turned off.
return mutableListOf("--xr_mode_regular", "--xr-mode", "off")
updateCommandLineParams(arrayOf("--xr_mode_regular", "--xr-mode", "off"))

super.onCreate(savedInstanceState)
}

override fun supportsFeature(featureTag: String): Boolean {
Expand Down

0 comments on commit c54837b

Please sign in to comment.