问题
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