From 4b519317cd6d714750caa3bdaf3fb236bd3ec681 Mon Sep 17 00:00:00 2001 From: Anish Mishra Date: Fri, 3 Oct 2025 15:59:37 +0530 Subject: [PATCH] Android Editor: Update suspend button icon in GameMenuBar --- .../editor/embed/GameMenuFragment.kt | 8 ++++---- .../editor/src/main/res/drawable/suspend.xml | 18 ++++++++++++++++++ .../res/layout/game_menu_fragment_layout.xml | 4 ++-- 3 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 platform/android/java/editor/src/main/res/drawable/suspend.xml diff --git a/platform/android/java/editor/src/main/java/org/godotengine/editor/embed/GameMenuFragment.kt b/platform/android/java/editor/src/main/java/org/godotengine/editor/embed/GameMenuFragment.kt index 0c3c76a37d7..c4f11245082 100644 --- a/platform/android/java/editor/src/main/java/org/godotengine/editor/embed/GameMenuFragment.kt +++ b/platform/android/java/editor/src/main/java/org/godotengine/editor/embed/GameMenuFragment.kt @@ -125,8 +125,8 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener { private val collapseMenuButton: View? by lazy { view?.findViewById(R.id.game_menu_collapse_button) } - private val pauseButton: View? by lazy { - view?.findViewById(R.id.game_menu_pause_button) + private val suspendButton: View? by lazy { + view?.findViewById(R.id.game_menu_suspend_button) } private val nextFrameButton: View? by lazy { view?.findViewById(R.id.game_menu_next_frame_button) @@ -267,7 +267,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener { menuListener?.closeGameWindow() } } - pauseButton?.apply { + suspendButton?.apply { setOnClickListener { val isActivated = !it.isActivated menuListener?.suspendGame(isActivated) @@ -348,7 +348,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener { isGameEmbedded = gameMenuState.getBoolean(BaseGodotEditor.EXTRA_IS_GAME_EMBEDDED, false) isGameRunning = gameMenuState.getBoolean(BaseGodotEditor.EXTRA_IS_GAME_RUNNING, false) - pauseButton?.isEnabled = isGameRunning + suspendButton?.isEnabled = isGameRunning nextFrameButton?.isEnabled = isGameRunning val nodeType = gameMenuState.getSerializable(BaseGodotEditor.GAME_MENU_ACTION_SET_NODE_TYPE) as GameMenuListener.NodeType? ?: GameMenuListener.NodeType.NONE diff --git a/platform/android/java/editor/src/main/res/drawable/suspend.xml b/platform/android/java/editor/src/main/res/drawable/suspend.xml new file mode 100644 index 00000000000..fdb8e60c7ee --- /dev/null +++ b/platform/android/java/editor/src/main/res/drawable/suspend.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/platform/android/java/editor/src/main/res/layout/game_menu_fragment_layout.xml b/platform/android/java/editor/src/main/res/layout/game_menu_fragment_layout.xml index 5160bea73fa..7ea65a9e234 100644 --- a/platform/android/java/editor/src/main/res/layout/game_menu_fragment_layout.xml +++ b/platform/android/java/editor/src/main/res/layout/game_menu_fragment_layout.xml @@ -18,12 +18,12 @@ android:orientation="horizontal"> + android:src="@drawable/suspend" />