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)
Asked
Active
Viewed 1,449 times
4
-
Got any solution ? Let me know it's solved by this http://stackoverflow.com/questions/39288879/bottom-sheet-fragment-comes-up-with-keyboard – LOG_TAG Feb 17 '17 at 07:53
-
This still seems to be just for keyboard behaviour..Not bottomsheet behaviour – Arpit Khurana Feb 17 '17 at 08:10
-
let me know the feedback on my answer it should work fine , are you using coordinated layout and scrollview as a parent view for your forms edittextfields? – LOG_TAG Feb 17 '17 at 09:03
-
1Yea scroll view wrapped by coordinator..I will try – Arpit Khurana Feb 17 '17 at 09:05
1 Answers
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
Credit:Mikepenz

LOG_TAG
- 19,894
- 12
- 72
- 105
-
2it 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
-
-
1Can 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
-
-
-
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