Louis Mondesir
Louis Mondesir

Reputation: 23

Android drag recycler view from bottom over map fragment

I would like to immitate google street view layout. I have a viewpager with a single map. I would like to display a recycler on the bottom of each page, and drag + scroll it from bottom. Here is the desired result (I don't need to hide the action bar) :

enter image description here

Would you know which layout to use in order to have the same drag / scroll from bottom effect?

I managed to have a single map for myviewpager :

enter image description here

but when I add the recyclerView in my viewpager fragments, it obviously hide the map :

enter image description here

Right now my tab fragment is only composed by the recyclerview

<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:visibility="invisible"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
tools:listitem="@layout/fragment_topic_list" />

I tried to use a bottom sheet but it was catching the map event, and I was unable to control the scroll (inertia).

Upvotes: 1

Views: 1643

Answers (1)

Zeeshan Shabbir
Zeeshan Shabbir

Reputation: 7114

Bottom Sheets are a lesser known part of the Design support library. The Design support library is an Android library intended to help android developers implement the Google material design guidelines.

Bottom sheets can be dragged up and down. You need to explore it more. I can point you toward some helpful resource. You should follow them. I really think they can help you.

Clone this plaid app's repo and study the code. It is using bottom sheet in it with drag and drop

Also follow this tutorial it will help you to understand the behavior of bottom sheet

I hope this answer will help you.

Upvotes: 1

Related Questions