Description
Toggling the FlyoutLayoutBehavior property on a Flyout page on Android causes the app to crash. The problem occurs in .NET 8 SR1 and SR2, and this problem also existed in .NET 7.
Steps to Reproduce
- Clone the linked repository
- Run the app on an Android tablet
- Click the "Toggle Flyout Behavior" button
- Notice the flyout menu closes (as expected)
- Expand the flyout menu and click the "Toggle Flyout Behavior" button
- Notice the app crashes
Link to public reproduction project repository
https://github.com/mjo151/maui-flyout-behavior-bug
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 (did not test other Android versions)
Did you find any workaround?
I did not find a workaround for this issue.
Relevant log output
Java.Lang.ClassCastException: androidx.appcompat.widget.LinearLayoutCompat$LayoutParams cannot be cast to androidx.drawerlayout.widget.DrawerLayout$LayoutParams
at java.lang.ClassCastException: androidx.appcompat.widget.LinearLayoutCompat$LayoutParams cannot be cast to androidx.drawerlayout.widget.DrawerLayout$LayoutParams
at at androidx.drawerlayout.widget.DrawerLayout.getDrawerViewAbsoluteGravity(DrawerLayout.java:991)
at at androidx.drawerlayout.widget.DrawerLayout.checkDrawerViewAbsoluteGravity(DrawerLayout.java:996)
at at androidx.drawerlayout.widget.DrawerLayout$ViewDragCallback.onViewPositionChanged(DrawerLayout.java:2292)
at at androidx.customview.widget.ViewDragHelper.continueSettling(ViewDragHelper.java:779)
at at androidx.drawerlayout.widget.DrawerLayout.computeScroll(DrawerLayout.java:1375)
at at android.view.View.updateDisplayListIfDirty(View.java:22044)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.updateDisplayListIfDirty(View.java:22052)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.updateDisplayListIfDirty(View.java:22052)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.updateDisplayListIfDirty(View.java:22052)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.updateDisplayListIfDirty(View.java:22052)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.updateDisplayListIfDirty(View.java:22052)
at at android.view.View.draw(View.java:22925)
at at android.view.ViewGroup.drawChild(ViewGroup.java:4529)
at at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4290)
at at android.view.View.draw(View.java:23197)
at at com.android.internal.policy.DecorView.draw(DecorView.java:821)
at at android.view.View.updateDisplayListIfDirty(View.java:22061)
at at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:689)
at at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:695)
at at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:793)
at at android.view.ViewRootImpl.draw(ViewRootImpl.java:4670)
at at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4381)
at at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3600)
at at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2328)
at at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9087)
at at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1231)
at at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at at android.view.Choreographer.doFrame(Choreographer.java:832)
at at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at at android.os.Handler.handleCallback(Handler.java:942)
at at android.os.Handler.dispatchMessage(Handler.java:99)
at at android.os.Looper.loopOnce(Looper.java:201)
at at android.os.Looper.loop(Looper.java:288)
at at android.app.ActivityThread.main(ActivityThread.java:7872)
at at java.lang.reflect.Method.invoke(Native Method)
at at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Description
Toggling the FlyoutLayoutBehavior property on a Flyout page on Android causes the app to crash. The problem occurs in .NET 8 SR1 and SR2, and this problem also existed in .NET 7.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/mjo151/maui-flyout-behavior-bug
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 13 (did not test other Android versions)
Did you find any workaround?
I did not find a workaround for this issue.
Relevant log output