CATROID-1668 Enhance shortcut management with UI integration and testing#5221
Open
harshsomankar123-tech wants to merge 26 commits into
Open
CATROID-1668 Enhance shortcut management with UI integration and testing#5221harshsomankar123-tech wants to merge 26 commits into
harshsomankar123-tech wants to merge 26 commits into
Conversation
…gment-level verification
…sion dialog - Add a cancel button to dialog_shortcut_pin.xml below the pin button - Rewrite showShortcutPermissionDialog to use the custom dialog layout with MIUI container (project icon, name, warning, styled buttons) instead of plain MaterialAlertDialogBuilder - Wire up cancel buttons in both showPinShortcutDialog and showShortcutPermissionDialog to dismiss the dialog
- Fix empty unsupported_launcher test with @ignore and honest reason - Add POCO device exclusion unit tests (isShortcutSupported, menu hiding) - Add duplicate pin guard in ShortcutHelper.pinProject() + test - Add intent flags (FLAG_ACTIVITY_NEW_TASK | CLEAR_TASK) to trampoline - Add XmlHeader projectUuid generation tests (null, repeated, blank, compat) - Add cancel button dialog dismiss stub test - Add shortcut_already_pinned string resource
There was a problem hiding this comment.
detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



JIRA TICKET: https://catrobat.atlassian.net/browse/CATROID-1668
Screen-Recordings of Main Feature
Screen.Recording.2026-04-24.at.05.59.50.mov
Screen Recording of delete and rename Feature
Screen.Recording.2026-04-24.at.06.01.30.mov
Screen.Recording.2026-04-24.at.06.02.14.mov
For Xiaomi Devices which needs manual permission first
https://youtube.com/shorts/sYn-YLzpNK0?feature=share
Summary
This PR introduces the ability for users to pin Catroid projects as shortcuts directly on their Android home screen. Tapping a pinned shortcut launches the project immediately via a lightweight trampoline activity, bypassing the main app navigation. It includes robust OEM-specific handling, specifically addressing MIUI permission restrictions and completely hiding the feature on unsupported POCO devices.
Core Implementation
ARGB_8888toRGB_565at half-resolution).ProjectActivity.EXTRA_IS_FROM_SHORTCUTflag so that pressing "back" after a shortcut launch cleanly exits the app instead of showing the stage dialog.projectUuid(auto-generated UUID) to future-proof shortcut identity tracking.OEM Compatibility & Device Handling
AppOpsManager(OpCode10017) to accurately detect if the "Install shortcut" permission is granted.PermissionsEditorActivityfirst before falling back toACTION_APPLICATION_DETAILS_SETTINGS.isShortcutSupported()forcibly returnsfalse, ensuring the menu option does not appear at all to prevent silent system rejections.UI & Resources
dialog_shortcut_pin.xmlfor a custom floating dialog displaying the project icon, name, pin action, and a specific MIUI warning container.bg_shortcut_dialog.xml, etc.), a borderlessShortcutPinDialogstyle, and relevant string/color resources.Testing
StageActivityback-press tests are@Ignore'd because they require a full OpenGL/GPU context tied to the libGDXAndroidApplicationconstraint).kotlinx-coroutines-testfor testing suspend functions.How to Test
Note: This feature behaves differently across devices, so testing may vary by manufacturer. I have tested it on Redmi, Motorola, Samsung, and OnePlus devices, and all features are working as expected on these. I will continue testing on more devices, but if you have a device from a different brand, please test this feature and let me know if you encounter any issues.
Your checklist for this pull request
Please review the contributing guidelines and wiki pages of this repository.