Skip to content
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

adjustResize not working #196

Closed
tgivslife opened this issue Apr 8, 2015 · 8 comments
Closed

adjustResize not working #196

tgivslife opened this issue Apr 8, 2015 · 8 comments

Comments

@tgivslife
Copy link

When you have a fragment with editText in it inside a scrollview and also a Navigation Drawer, when you focus the editText you can't scroll the contents of the fragment and the editText ends up behind the keyboard. If I remove the Navigation Drawer the editText is placed above keyboard and I can also scroll to view rest of content. This only happens on Lollipop.

@tgivslife
Copy link
Author

I found the problem. Its the translucent status bar. When its enabled you set the flag SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN

 if (Build.VERSION.SDK_INT >= 19) {
                if (mTranslucentStatusBarProgrammatically) {
                    mActivity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
                }
            }

When I set withTranslucentStatusBar(false) the adjustResize is working again and I can scroll the layout when the keyboard is shown.

@mikepenz
Copy link
Owner

mikepenz commented Apr 8, 2015

@NamingException yeah this is a known behavior of this FLAG. So i've implemented a util which will enable support for keyboards and this behavior. It lowers the layout size and adds enough padding to the bottom.

You can enable this by calling .keyboardSupportEnabled(activity, enabled) on the Drawer.Result.
The sample application also contains a sample with this in use

@mikepenz mikepenz closed this as completed Apr 8, 2015
@mikepenz mikepenz self-assigned this Apr 8, 2015
@GreenSkinMonster
Copy link

Hi,

I had same issue, and it took me some time to find this question.
.keyboardSupportEnabled(activity, enabled) worked well with .withTranslucentStatusBar(true) .
Maybe this should be in the document? Soft keyboard is used a lot.

Only one small problem, it will show a blue (colorPrimary) background before soft keyboard appear, which won't happen with .withTranslucentStatusBar(false) .

I upload a video to show the problem.
https://youtu.be/tc158Otf5II

@mikepenz
Copy link
Owner

@GreenSkinMonster to get it working i've created the keyboardSupport function. It is in the sample app. The thing is that in fact this is no issue of the MaterialDrawer. It's Android functionality, and people don't know about this. There were other issues regarding this. If you have FullScreen the adjustResize won't work anymore.

So to "fix" it i will resize the layout. as far as i can, i can't fix the display. the blue is your background color so you can change this.

@mikepenz
Copy link
Owner

#95, #183

@GreenSkinMonster
Copy link

@mikepenz Thank you for the reply and document update.
Sorry I missed those discussions.
I think they answered my question.

This a great project with great support.
Thanks.

@mikepenz
Copy link
Owner

@GreenSkinMonster no problem.

Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants