-
Notifications
You must be signed in to change notification settings - Fork 533
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
IOnApplyWindowInsetsListener problem with Android 15. #9505
Comments
I don't understand what you consider to be the bug, and skimming gmck/NavigationGraph9Net9 is not enlightening. I have to imagine (hope) that the issue isn't due to .NET for Android bindings, but instead due to the underlying Android APIs. Have you tried searching stackoverflow.com /etc. for Java/Kotlin variants of this question/scenario? |
I don't understand what you consider to be the bug, and skimming gmck/NavigationGraph9Net9 is not enlightening. I thought I spelled it out in README. You can see it readily enough if you build and run it. I have to imagine (hope) that the issue isn't due to .NET for Android bindings, but instead due to the underlying Android APIs. The more I work with it, the less I think it is a bug in your .NET for Android bindings. I’m also unaware of anyone having the same issue on any Android (Kotlin/Java) forums, but I can’t say I’ve looked at any particular Kotlin/Java forum. Have you tried searching stackoverflow.com /etc. for Java/Kotlin variants of this question/scenario? Yes, I found an answer to a specific question: How to detect full screen gesture mode in android 10 I’ve since converted the recommended answer from the above and tested it in my example, and that function works equally as well as mine and also eliminates the problem. Therefore, assuming that most net8.0-android apps will have a fragment with RecyclerView, these guys will hit this issue when they upgrade to net9.0-android35 as soon as they enable edge-to-edge. I’ve never had that requirement with any other IOnApplyWindowInsetsListener with a RecyclerView before, and I've never read about any such requirement in the Android 15 docs. In searching for an answer, I also came across Redth’s [Android] Apps compiled for 15.0 / 35 default displaying as Edge to Edge #24742 issue. If that is how they want to do it in Maui, that’s fine, but it’s still just a cop-out. Why even bother moving from Android 14 if you aren’t going to enable edge-to-edge? I raised the issue here first to bring it to your attention, and second, there doesn’t seem to be a particular forum devoted to .Net for Android where developers can discuss problems. The Shanghai Police moderators have turned https://learn.microsoft.com/en-us/answers/tags/18/xamarin into a useless forum, and StackOverflow is still Xamarin.Android. You can no longer get an answer about Xamarin.Android and Android 14, even though, thanks to you guys, you gave us a perfectly viable solution for Android 14 for at least another 12 months. If you attempt to answer an X.A. API 34 question, the Shanghai Police now delete your answer. Consequently, people have left – not a single question so far in November. Why can’t MS create another forum for .Net for Android (without the Shanghai Police) so the existing Xamarin forum can quietly fade away? Then, make a separate new Maui forum for those guys. |
@jonpryor As it didn’t have the BooksFragment, I added the BooksFragment-related code from NavigationGraph9Net9 to NavigationGraph8Net8 to check the behaviour of the recyclerview using net8.0-android. The difference using the net8.0-android project is that there is no need for the IsGestureNavigation() function. However, what I came up with for going edge-to-edge differs from how Android 15 does, as I relied on I have no objection to using IsGestureNavigation(); I’m just concerned that I’ve only tested it on the limited number of phones I listed in the readme. |
Android framework version
net9.0-android
Affected platform version
VS2022 17.12.0 Prev 4.0
Description
Since I worked around the problem I reported in #9244, rather than continuing to develop my app with net8-android, I thought I would look at the issues I might hit when moving to net9.0-android35 with a test project. Going edge-to-edge will mean reworking Material3 themes, especially since Android has not only deprecated but removed both SetStatusBarColor() and SetNavigationBarColor() from Android 15.
I encountered bizarre behaviour when closing the fragment when trying to get edge-to-edge to work correctly with a fragment containing a RecylerView on all devices Api 29 - 35. To get around the problem, I had to create a method to determine what mode of Navigation was being used, i.e. Gesture or 3-button.
I’m not sure if this should be classified as a bug, but as I’ve never had that requirement previously with any other IOnApplyWindowInsetsListener or read about any such requirement in the Android 15 docs, I thought I should raise it as an issue here.
The test project is at https://github.com/gmck/NavigationGraph9Net9. The readme explains the bizarre closing behaviour and the new method for circumventing it.
Steps to Reproduce
See the test project above.
Did you find any workaround?
Yes
Relevant log output
The text was updated successfully, but these errors were encountered: