Skip to content

Account for Android Q Gestural Navigation #32748

Closed

Description

@PieterAelse

The new Gestural Navigation of Android Q interferes with touch/swipe regions inside any Flutter app. SafeArea doesn't take it into account.

Steps to reproduce:

  • Get a Pixel or any other supported device
  • Enrol to the Q beta program
  • Download/install latest Q beta
  • Go to settings => system => gestures and turn on "Fully Gestural Navigation"
  • Open a Flutter app with a swipeable widget on the left/right and prepare to navigate back 🙃 ...

Example widgets which will be impacted:

  • Pagers
  • Sliders
  • Drawer
  • etc..
  • ...

Google info video which also explains how to get insets natively: https://www.youtube.com/watch?v=Ljtz7T8R_Hk

Screenshot from the video showing the regions:
Screenshot 2019-05-15 at 09 55 13

Activity

  1. miguelcmedeiros commented on May 15, 2019

    @miguelcmedeiros

    @filiph, can you please label this issue with customer:solaris?

  2. Zazo032 commented on May 15, 2019

    @Zazo032
    Contributor

    Maybe SafeArea() should take this into account and only draw widgets within the safe area of the device (i.e. not placing widgets in both sides for safer back gesture).

  3. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    platform-androidAndroid applications specifically
    on May 15, 2019
  4. audkar commented on May 20, 2019

    @audkar

    Example widgets which will be impacted

    also Drawer

    Would be very good if this could be addressed before Android Q stable is released and users start using gesture navigation

  5. audkar commented on May 30, 2019

    @audkar

    @filiph IMHO customer also is a crowd :)

    I am not sure if Flutter team is even aware what is going to happen when next android stable version going to be released in a few months (~3 months)... Users with new android version will not be able to open Drawers, BottomSheets, change slider values from the edge of screen. So partially Flutter apps will be broken.

    I hope that I am mistaken and Flutter team is already working on adapting Material widgets to work with Gesture Navigation. Because not much time left and from my understanding this is not trivial task to implement this correctly.

  6. eseidelGoogle commented on Jul 1, 2019

    @eseidelGoogle
    Contributor

    @HansMuller is probably the best to comment here. Thanks!

  7. HansMuller commented on Jul 1, 2019

    @HansMuller
    Contributor

    @audkar We're aware of the changes and will link to PRs that address them here.

    Apps need to be informed about Q's gesture navigation insets (as well as the "mandatory" vertical ones), they need to be able to disable the left/right back gesture support, and extend apps full-screen. We've asked for some feedback from the Material Design team about how to handle a scaffold's drawer when back gesture is in effect.

  8. Zazo032 commented on Jul 2, 2019

    @Zazo032
    Contributor

    This is going to be tweaked a bit in the upcoming Android Q beta 5: https://twitter.com/chrisbanes/status/1146050918892412928

  9. HansMuller commented on Jul 2, 2019

    @HansMuller
    Contributor

    @Zazo032 - right, opening the drawer upon long-press-then-swipe is consistent with the "new features" item here: https://developer.android.com/jetpack/androidx/releases/drawerlayout

  10. 7 remaining items

  11. shihaohong commented on Aug 13, 2019

    @shihaohong
    Contributor

    Hi all, I'm currently working on getting Flutter to handle Android Q Gestural Navigation. I'm going to list out the different tasks that need to be completed to help myself keep track of progress and what else needs to be done. This will also help if I missed anything:

    • Expose insets.systemGestureInsets on MediaQuery.of(context).systemGestureInsets
      This allows developers to place draggable widgets outside of the system gesture insets
    • Expose setSystemGestureExclusionRects API
      This allows developers to change remove gestures from non-mandatory insets. After exposing the API to the framework, the next step would be to create a convenience widget that sends wraps itself in the exclusion rect.
    • Expose getSystemGestureExclusionRects API
      Conversely, it would be good to have a way to query what system gesture exclusion rects have been set.
    • Expose insets.mandatorySystemGestureInsets on MediaQuery.of(context).mandatorySystemGestureInsets
      This provides information regarding gesture insets that cannot be removed to the framework, if it is needed.
    • Expose insets.systemWindowInsets.bottom
      There is some tricky logic in the engine that sets MediaQueryData.viewInsets and MediaQueryData.padding to be zero to handle keyboards/hidden nav bar(Keyboard inset detection heuristic to distinguish when to include bottom inset. flutter-team-archive/engine#6288). We will need to provide the unchanged systemWindowInset values Android provides.
  12. danwulff commented on Sep 3, 2019

    @danwulff

    Android 10 is now released: https://twitter.com/Android/status/1168935724655218691

    I'm really hoping the above changes can be completed relatively soon.

  13. audkar commented on Sep 3, 2019

    @audkar

    @HansMuller so Android 10 stable is officially released. What would be flutter team recommendations for Flutter apps which navigation is based on NavigationDrawer? My app is unusable now...

  14. HansMuller commented on Sep 3, 2019

    @HansMuller
    Contributor

    @audkar The app drawer should still open with a long-press swipe and with its appbar button. Why is your app unusable?

  15. audkar commented on Sep 3, 2019

    @audkar

    Yes, sorry. Was trying on old emulator which didn't had long-press.

  16. modified the milestones: August 2019, on Sep 3, 2019
  17. modified the milestones: , September 2019 on Sep 3, 2019
  18. shihaohong commented on Sep 5, 2019

    @shihaohong
    Contributor

    I've moved the items in my original comment over to its own issue (see #39858) to help others easily find the work that needs to be done. I will close this in favor of the other issue.

  19. Zee2 commented on Nov 7, 2020

    @Zee2

    What is the status on this? As of November 2020, there is still no way to do proper draw-behind-the-navbar Android Q-style rendering with Flutter. This is really important!

  20. cstmth commented on Jun 23, 2021

    @cstmth

    The issue with the Drawer is still not resolved. There is a workaround though:

    Scaffold( drawer: Drawer(), drawerEdgeDragWidth: MediaQuery.of(context).size.width, // ... )

    This allows swiping from the entire screen width.

  21. github-actions commented on Jul 31, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  22. locked as resolved and limited conversation to collaborators on Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

customer: crowdAffects or could affect many people, though not necessarily a specific customer.customer: solarisframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesplatform-androidAndroid applications specifically

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions