Replicate keyboard like layout upward push in bottom sheet

筅森魡賤 提交于 2019-12-10 10:58:42

问题


Is there any way to manually push up layout (scrollview or recyclerview or whole activity) when bottom sheet opens just like android keyboard does? Or you can say that i want to make a minimal keyboard in form of a bottom sheet(which isn't using any editable view)


回答1:


100% working formula

Use this in onCreateDialog in BottomSheetFragment

KeyboardUtil(getActivity(), view);

or

For fragment use

new KeyboardUtil(this, findViewById(R.id.fragment_container));

by using this Util class

https://github.com/mikepenz/MaterialDrawer/blob/aa9136fb4f5b3a80460fe5f47213985026d20c88/library/src/main/java/com/mikepenz/materialdrawer/util/KeyboardUtil.java

Credit:Mikepenz



来源:https://stackoverflow.com/questions/42264588/replicate-keyboard-like-layout-upward-push-in-bottom-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!