I want to create a collasping toolbar in which my custom layout is located . The image below shows the use of the newly released design.support library. On img.1, the element (ImageView) disappears. In my project, I want to remove the layout. Since there will be a ViewPager inside the Layout, it cannot be changed like an image, it must dissolve in the background of the toolbar - it must become transparent.
img. one
Additional Information I want to open / hide the Layout toolbar by moving the toolbar - belt to move - bright blue layout. So expand / collapse is not like img. 1 Instead, it should work as a status bar that moves up and down the blick on the ToolbarFooter.
img.2
I think I read a lot about it ( crumbling with a button , layout inside ), but I found any hint or implementation. I do not know how to approach this topic. I believe that my ViewPager and RelativeLayout (or something else) should be outside the toolbar. And they should just take a place in the toolbar, for example:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout 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" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false"> <android.support.v7.widget.Toolbar android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_max_height" android:minHeight="?attr/actionBarSize" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" app:theme="@style/AppBarTheme"> <Button android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_alignParentTop="true" android:layout_gravity="left|top" android:gravity="center_vertical|left" android:text="ToolbarTitle" android:background="?android:attr/selectableItemBackground" android:textAllCaps="false"/> </android.support.v7.widget.Toolbar> <net.android.app.views.ViewPagerToolbar android:id="@+id/calendar_viewpager" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginTop="?attr/actionBarSize"/> <RelativeLayout android:id="@+id/toolbar_footer" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:layout_alignParentTop="false" android:layout_alignBottom="@+id/app_bar"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="8dp" android:text="@string/belt_to_move"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:text="@string/belt_to_move"/> </RelativeLayout> <android.support.v4.widget.DrawerLayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@+id/app_bar"> <android.support.v4.view.ViewPager android:id="@+id/vp_container" android:layout_width="match_parent" android:layout_height="match_parent"/> </android.support.v4.widget.DrawerLayout> </RelativeLayout> <android.support.design.widget.NavigationView android:id="@+id/navView" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start"/>
Now will someone tell me which component to use? Support library offers CoordinateLayout, CollapsedToolbar, Appbar. By standard approaches, you can use RelativeLayout or FrameLayout, which overlap the view. So, guys, what do you recommend to me, how should I eat this cake?
UPDATED:
Finally, I found a solution. This is not CollapsingToolbar, but ViewDragHelper. Next Solution: Blog , GitHub Project , Description of YouTube ,
source share