1

I have a BottomSheetDialogFragment which is opened from another fragment.

bottom_sheet_fragment.xml:

<LinearLayout>
<TabLayout/>
<ViewPager>
</LinearLayout>

I have two fragments for the view pager each of which contains an EditText and a RecyclerView in vertical fashion.

view_pager_fragment1.xml:

<LinearLayout>
    <EditText/>
    <RecyclerView>
    </LinearLayout>

Now when ever I click on the edit text a part of recycler view is getting hidden behind the key board.

Expected: When ever keyboard appears the bottomsheet should scroll up so that the recycler view contents remain visible.

Vasily Kabunov
  • 6,511
  • 13
  • 49
  • 53
jaede
  • 859
  • 1
  • 8
  • 13

1 Answers1

8

I've managed to achieve the behavior you want by making the root view of the BottomSheetFragment layout a android.support.v4.widget.NestedScrollView. Don't know if its going to work for you, as you seem to be using other scroll views inside.

Vasily Kabunov
  • 6,511
  • 13
  • 49
  • 53
Thalis Vilela
  • 335
  • 1
  • 10
  • cool. it works. Looks like the culprit is the recycler view inside bottom sheet. will try to see some workaround for that scenario :) thanks. – jaede Aug 23 '17 at 09:59
  • Your solution worked for me when I use 26.0.0-alpha1 of support design library. But the moment I change the version it stops working. – Kiran Kumar Nov 10 '17 at 11:51
  • @user3128700 did you ever solve it for the RecyclerView? – kassim May 22 '18 at 14:46