mikepenz / MaterialDrawer

The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.

Home Page:https://mikepenz.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About windowSoftInputMode, DrawerLayout and issue #95

raguirre opened this issue · comments

First of all, Mike you are a genius for solving issue #95. I'm so thankful you solved it, I've been banging my head for 3 days now trying to understand just what was happening.

Seeing what Google is doing with most of its apps, there is no reason to completely remove the drawer from an activity that makes use of the keyboard, but if they are doing it it just seems to me they're aware of the situation, and along with the fact that nowhere in the documentation could I find that these 2 scenarios are incompatible, leads me to believe that this is a genuine bug within DrawerLayout. This, and the fact that I tested an activity without a drawer but with translucent status bar and it resized without a problem. I will look into it and see if I can file a bug.

Here's my request:
I would like an instance of the KeyboardUtil to be added by default to all new drawers being created. From what I can tell, there's no downside to it. This way, people who have no idea about the bug won't even realize there's a bug at all.

If there is indeed a downside to it, then I think it would be just fair to put a warning in the readme or a mention about it in the wiki. After hours of Google searches I could not find anywhere that the bug was related to DrawerLayout. I was just lucky enough to find that you had already hacked it.

Nevertheless, thanks again for solving the issue and for making this amazing library.

EDIT:
Okay nevermind, after further testing of the KeyboardUtil in my main activity which holds a ViewPager, I do see some noticable frame drops when I scroll around the different pages because of the OnGlobalLayoutListener. So I thought it would be a good idea to have the option to add and remove the listener on demand, as it could only be needed in some fragments, and removing it while it's not needed will improve performance. Something like activateListener() and deactivateListener(). Thanks :)

@raguirre thanks for the detailed description.

When i tried to solve this issue i also searched a lot for any documentation or solution how to solve it. but it seems that as soon as you use a newer api version and the FULLSCREEN flag that any functionality of the keyboard stuff like adjustView won't work anymore.

So it really makes sense to add this to the drawer you are right. having a keyboard is a common task and if there are issues people won't find the solution. (or they search for 4+ hours)

i was afraid adding it as default because i did not know if it will cause any troubles. but for now it seems really stable.

so adding it with the mentioned methods makes sense ;). i will add them in the next version.

i see something like.

Drawer.Result result = ...
result.enableKeyboardSupport(activity)
result.disableKeyboardSupport(activity)

@mikepenz thanks for the reply.

It was the best you could have done not adding it by default, cause it breaks other things, like viewpager pagination. Since the post I also realized it broke the animation in my sliding tabs (indicator for the viewpager), now they just move from one tab to the next without animating.

And yeah, methods working directly on the Drawer.Result sound great :)

Thanks and looking forward to the next version :)

@raguirre with the next version there will be a method called

result.keyboardSupportEnabled(activity, true);

you can disable it again with this:

result.keyboardSupportEnabled(activity, false);

@mikepenz Awesome! Thank you very much. :)

hi Dear Mike

i saw your library and i installed your application,i'm new android developer and i cant use this library!

may you help me with an step by step guidance for use your library?

thanks...

@mehdinewdesign there is the sample app available showing how the lib is used, you also can see how the MaterialDrawer needs to be setup in the README.

No step by step guidance possible.

Thank you...

Hi
I just want to use your minidrawe and I can't find out how to do this...

Additionally I read the README file and it can not help me...

May help me for this go?

Thank you...

@mehdinewdesign not sure why you ask this inside an issue which has nothing to do with your question. Here you can find the sample app: https://github.com/mikepenz/MaterialDrawer/tree/develop/app including a sample for MiniDrawer

Hi
Dear Mike,I'm sorry because of my continuously questions , but really I cant use your sample and your library :-(
Did your have any learning lecture about mini drawer in YouTube?
Your design and programming for this sample is awesome , but because of I'm new in android programming I cant use this...

I'm so eager for your answer that make me guide for creating a mini drawer.

Thank you so much... :)