I have this layout with data binding and coordinator Layout, which contains button on bottom which hides while scrolling down. I want to show Snackbar on this screen, but if i show it, it shows above the button, but i want it to be on top of button
Here is layout:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
...
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/mainCoordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
...
<FrameLayout
android:id="@+id/buttons"
...
app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior"
app:layout_constraintBottom_toBottomOf="parent">
<com.google.android.material.button.MaterialButton
android:id="@+id/button"
.../>
</FrameLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
This is how i show snackbar:
Snackbar.make(ContextThemeWrapper(binding.root.context), binding.root, message, length).show()
i’ve tried to make this framelayout gone but snackbar still shows above this area where button should be
New contributor
Mihail Lovchitskiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.