0

I have layout structure like this:

<androidx.coordinatorlayout.widget.CoordinatorLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <!-- other layout content goes here -->

    </androidx.core.widget.NestedScrollView>

    <com.google.android.material.bottomappbar.BottomAppBar
        android:id="@+id/bottomBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        app:hideOnScroll="true"
        app:menu="@menu/menu_continue" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

NestedScrollView fills whole screen. If it happens scroll content is about the height of the screen (but not more then that), user sees non-scrollable content (because from NestedScrollView point of view there is no need to scroll) that goes under BottomAppBar.

Now I can easily workaround this by adding bottom padding or margin to the scroll view, but to me it's a hack. Is there any adequate clean solution to this problem?

ror
  • 3,295
  • 1
  • 19
  • 27
  • adding padding isn't a bad idea. why did you think that it's a "hack"? – HeyAlex Apr 11 '20 at 22:10
  • @HeyAlex primarily because I have to adapt to various sizes of BottomAppBar can have under various SDKs/screen dimensions/portrait/landscape orientations. On the other hand there seems to be just 2 size boundaries currently (56dp and 60 something - don't remember) but this can change in the future. – ror Apr 12 '20 at 04:44

0 Answers0