4

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)

Arpit Khurana
  • 144
  • 2
  • 14

1 Answers1

0

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

LOG_TAG
  • 19,894
  • 12
  • 72
  • 105
  • 2
    it worked ..thanks..though required minor changes.The idea of setting padding to the content was the required thing – Arpit Khurana Feb 18 '17 at 09:43
  • great, do share if you get any better solution ! – LOG_TAG Feb 18 '17 at 19:11
  • 1
    Can anybody share some code on how this was accomplished please? I was able to add the bottom sheet to my current layout, but currently when clicking on my layout, it is not pushing the whole layout out. I'm doubting that I'm not implementing the new KeybordUtil correctly. – Red M Jun 02 '17 at 18:15
  • @LOG_TAG Got any solution for BottomSheetBehavior ? – RamithDR Feb 08 '18 at 06:38
  • @RamithDR what is the problem you are facing? – LOG_TAG Feb 08 '18 at 09:51
  • In some devices like Samsung, this was not the ideal case. The layout was already being pushed up with the keyboard and the padding was additionally applied to push the layout further upwards. – Debdeep Jun 24 '19 at 13:48
  • @Debdeep, how did you solve for the extra padding on the devices you mentioned? Was facing a similar issue & don't have a solve yet. – Ankit Wadhawan Aug 05 '19 at 09:04
  • @AnkitWadhawan See this link https://stackoverflow.com/a/57089779/5685358. Might be of some help. – Debdeep Aug 05 '19 at 09:08