mikepenz / MaterialDrawer

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
https://mikepenz.dev
Apache License 2.0
11.67k stars 2.05k forks source link

Soft input (keyboard) remains open on navigation #2772

Closed Sternbach-Software closed 2 years ago

Sternbach-Software commented 2 years ago

About this issue

Details

Checklist

mikepenz commented 2 years ago

Thank you for the report @shmueldabomb441

Wouldn't a normal listener on the DrawerLayout (e.g. after the layout is closed) also serve the same functionality? Also I wonder, why did you not close the keyboard when the DrawerLayout was opened already?

Sternbach-Software commented 2 years ago

Because when setting it up with the navigation component, the onclick listener is set to deal with the navigation, so setting it myself would be counter productive. It is a single listener, not an array of listeners.

Sternbach-Software commented 2 years ago

Also, it isn't certain that the user will navigate just when the open the drawer. They could be checking the email in the header or something.

mikepenz commented 2 years ago

I'd argue that the common approach is to close the keyboard when opening the drawerLayout: https://developer.android.com/reference/androidx/drawerlayout/widget/DrawerLayout.DrawerListener

Will need to think more about adding another listener

Sternbach-Software commented 2 years ago

How would you do it like you're saying while allowing it to set up the listener for the Navigation component? I can hear where you are coming from, because the keyboard may block the user from one of the list items, in which case they will close it themselves anyway, so the app might as well do it for them.

mikepenz commented 2 years ago

Decided to get this listener added, dropped a commit though as it contained unused code, and added backwards compatiblity.

mikepenz commented 2 years ago

This will land in v9