[Android] Follow up fixes to enabling orientation change in the script editor
- Fix project manager crash when rotating the device - Fix title bar disappearing when rotating large screen devices (tablet and foldables)
This commit is contained in:
+4
-5
@@ -256,8 +256,7 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
|
||||
|
||||
// Skip permissions request if running in a device farm (e.g. firebase test lab) or if requested via the launch
|
||||
// intent (e.g. instrumentation tests).
|
||||
val skipPermissionsRequest = isRunningInInstrumentation() ||
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && ActivityManager.isRunningInUserTestHarness()
|
||||
val skipPermissionsRequest = isRunningInInstrumentation() || ActivityManager.isRunningInUserTestHarness()
|
||||
if (!skipPermissionsRequest) {
|
||||
// We exclude certain permissions from the set we request at startup, as they'll be
|
||||
// requested on demand based on use cases.
|
||||
@@ -279,9 +278,9 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
|
||||
// Show EditorTitleBar only in landscape due to width limitations in portrait.
|
||||
// Show EditorTitleBar on small screens only in landscape due to width limitations in portrait.
|
||||
// TODO: Enable for portrait once the title bar width is optimized.
|
||||
EditorUtils.toggleTitleBar(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
|
||||
EditorUtils.toggleTitleBar(isLargeScreen || newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
@@ -805,7 +804,7 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
|
||||
}
|
||||
|
||||
PermissionsUtil.REQUEST_INSTALL_PACKAGES_REQ_CODE -> {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !packageManager.canRequestPackageInstalls()) {
|
||||
if (!packageManager.canRequestPackageInstalls()) {
|
||||
Toast.makeText(
|
||||
this,
|
||||
R.string.denied_install_packages_permission_error_msg,
|
||||
|
||||
+1
-4
@@ -181,10 +181,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
|
||||
PopupMenu(context, optionsButton).apply {
|
||||
setOnMenuItemClickListener(this@GameMenuFragment)
|
||||
inflate(R.menu.options_menu)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
menu.setGroupDividerEnabled(true)
|
||||
}
|
||||
menu.setGroupDividerEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user