M
M
MikkiMouse2015-11-12 10:53:05
Android
MikkiMouse, 2015-11-12 10:53:05

How to make Toolbar transparent on scroll?

Good afternoon, at the moment the activity layout looks like this:

<FrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:background="?attr/colorPrimary"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/fragmentContainer"/>

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@android:color/transparent">
    </android.support.v7.widget.Toolbar>
    
</FrameLayout >

And everything seems to be fine, the toolbar turns out to be transparent, but the fragment is inserted in full screen and a transparent toolbar is superimposed on it. I want the fragment to be inserted as usual, under the toolbar, and when scrolling up, the toolbar becomes transparent.
What I want is implemented in QuickPic.
I tried to make paddings for the size of the toolbar, but in this case the toolbar gets a fixed color and it doesn't become transparent when scrolling. How to be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question