Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Support showing Google Maps-like BottomSheet. #133

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

peruchali
Copy link

Issue:

  • Currently the BottomSheet implementation (on Android) always shows Z-order wise above other components like bottom navigation bar, tab bars, and flyouts.
  • Google Maps shows a BottomSheet that is "within" the page - the sheet shows up vertically above (rather than in front of) the bottom navigation/tab bars.
  • To implement such an experience, rather than adding the BottomSheet StayOnFrontView to the root ViewGroup, instead add it as a sibling of AppBarLayout.
  • This ensures that the BottomSheet shows up behind the navigation bar/Tab bar on the bottom (BottomNavigationView) and the flyouts.

Changes:

  1. BottomSheet, BottomSheetManager:
  • Provide another overload of ShowAsync to accept a Page.
  1. Android:
  • Update EnsureStayOnFrontView to show as a sibling of AppBarLayout when showing "inside" a page.
  1. sample:
  • AppShell: Force showing the bottom tab bar, and the flyout menu option.
  • MainPage: add test cases for modal and non-modal for the Google Maps style behavior.

This PR has no changes to any existing behavior or usage.

Google Maps style:
GoogleMapsStyle

(Regular sheets, unchanged behavior)
RegularSheet

Issue:
- Currently the BottomSheet implementation (on Android) always shows Z-order wise above other components like bottom navigation bar, tab bars, and flyouts.
- Google Maps shows a BottomSheet that is "within" the page - the sheet shows up vertically above (rather than in front of) the bottom navigation/tab bars.
- To implement such an experience, rather than adding the BottomSheet StayOnFrontView to the root ViewGroup, instead add it as a sibling of AppBarLayout.
- This ensures that the BottomSheet shows up behind the navigation bar/Tab bar on the bottom (BottomNavigationView) and the flyouts.

Changes:
1. BottomSheet, BottomSheetManager:
- Provide another overload of ShowAsync to accept a Page.

2. Android:
- Update EnsureStayOnFrontView to show as a sibling of AppBarLayout when showing "inside" a page.

3. sample:
- AppShell: Force showing the bottom tab bar, and the flyout menu option.
- MainPage: add test cases for modal and non-modal for the Google Maps style behavior.

This PR has no changes to any existing behavior or usage.
@peruchali
Copy link
Author

Should address #115

softlion added a commit to softlion/The49.Maui.BottomSheet that referenced this pull request Nov 7, 2024
- [android] Fix "no sliding away" blocked in hidden mode
- [android] Fix bottom sheet sometime displayed in hidden mode
- [android] Fix handle not appearing
- [android] [Demo app] Fix can't open the same demo item twice in a row
- Breaking: removed DetentsCollection. Use a ResourceDictionary to choose between detents with OnPlatform
softlion added a commit to softlion/The49.Maui.BottomSheet that referenced this pull request Nov 7, 2024
- [android] Fix "no sliding away" blocked in hidden mode
- [android] Fix bottom sheet sometime displayed in hidden mode
- [android] Fix handle not appearing
- [android] [Demo app] Fix can't open the same demo item twice in a row
- Breaking: removed DetentsCollection. Use a ResourceDictionary to choose between detents with OnPlatform
@softlion
Copy link

softlion commented Nov 7, 2024

Merged into that nuget, along with many fixes, oriented on stability.
https://github.com/softlion/The49.Maui.BottomSheet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants