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

.NET 9 Support #148

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

.NET 9 Support #148

wants to merge 6 commits into from

Conversation

Axemasta
Copy link

@Axemasta Axemasta commented Jan 21, 2025

The library currently doesn't work on .NET 9 for android due to BottomSheetBehavior moving to com.google.android.material.bottomsheet.BottomSheetBehavior. This has been reported in #142 and has been addressed in this PR.

Changes:

  • Updated target .NET version to .NET 9
  • Explicitly target latest maui controls release
  • Update nuget versions to latest available
  • Add props file to centrally manage net versions and target frameworks
  • Fix android implementation to no longer crash when showing a bottom sheet
  • Fix ios deadlock when using a RatioDetent with value not equal to 0.6f, this was caused by a recurisve layout loop kicking off infinite calls to Layout & LayoutSubViews. This was not an issue in .NET 8!
  • Add prop files to solution
  • Increase library version to 9.0.0

Upgraded everything to .net9, I couldn't get the package props working with my stuff so I've just axed it for now
The bottom sheet no longer crashes when presenting
Since i couldn't get this working earlier and deleted the package.props file, I've restored it and fixed my issues!
Increase major version due to .net 9 upgrade
I added these other platforms when trying to get .NET 9 working, now its all sorted we dont need them!
@Axemasta
Copy link
Author

I've found the source of the iOS ratio detent crash, the following method runs forever and causes a deadlock in the application. Will put a fix in with this PR!

There was a loop where when creating custom detent sizes, the layout views would enter a doom loop which would deadlock the ui thread.
@jonteohr
Copy link

When will this be merged into the main branch and update the nuget repo? Waiting to implement this into my .NET 9 android app!

@Humble2020
Copy link

Humble2020 commented Jan 27, 2025 via email

@Axemasta
Copy link
Author

I'm currently investigating an issue where bottom sheets on android don't present when you're in a modal page.

They get presented at the bottom level of your modal stack. Trying to see what I can do to fix & will update this PR when I work it out. I did try seeing if the issue is present in the Softlion version & its also there 😨

For any of you looking to use this, my advice would be either to pull the project source into your project & build it locally with your project, or build the package and host it somewhere thats what I'm doing!

@Humble2020
Copy link

Humble2020 commented Jan 27, 2025 via email

@lucacivale
Copy link

@Axemasta don't know if its interesting for you but I built a BottomSheet control aswell for .net 8. I just finished a big rework for .net 9 including non modals. The BottomSheets also work when you are in a modal page because I use Googles BottomSheetDialog under the hood. The APIs between this and my package differ a bit but probably it works for you.

@Axemasta
Copy link
Author

@lucacivale thanks, I am aware of your library and have been using your android implementation as part of the modal fix for the issue I've found on android.

Your library is very well presented however porting our main app to your library might be quite painful mostly due to the navigation changes. For this library we've built a custom navigation service which works a treat and unfortunately your libraries BottomSheetNavigationService isn't compatible with Prism due to using keyed services. I also think we'd need to do quite alot of reworking for the actual structure of our pages!

I've currently got the android BottomSheetDialog implementation working aside from switching between detents + supporting anchor detents. If i get nowhere I'll have a look at your library and see what I can do to port into my main app. This library hasn't seen support in a while and I can see yours is being actively developed so I'd rather help where its going to make more of a difference.

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.

4 participants