[Android] ListView ContextActions in modal page #26854
Open
+31
−0
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.
Description of Change
Android does not natively support applying an Action Mode to a DialogFragment. When startActionMode or startSupportActionMode is invoked, the Action Mode is associated with the Activity hosting the Fragment. This creates a usability issue because the DialogFragment often covers the navigation bar, which is where context actions are typically displayed. As a result, users may perceive that no action has been initiated. Furthermore, if the DialogFragment is closed while the context action is still active, the navigation bar remains in the context menu state, causing confusion.
To address this limitation, I propose intercepting the creation of the ActionMode when the FragmentManager detects a modal fragment. Instead of relying on the default implementation, we can introduce a custom solution that uses an action sheet within the modal navigation class. This ensures that context actions are visually and functionally tied to the DialogFragment, improving the overall user experience.
Issues Fixed
Fixes #21261
Screen.Recording.2024-12-30.at.00.40.43.mov
Screen.Recording.2024-12-30.at.00.38.36.mov