Lord_Gama
Lord_Gama

Reputation: 297

view above toolbar when exituntilcollapsed has been defined?

I have ImageView that goes between appbarlayout and the view with app:layout_behavior="@string/appbar_scrolling_view_behavior", when I scroll to up it must be above of toolbar.

to achieve this I also have defined a custom behavior that is an instance of AppBarLayout because I have a layout like this:

<CoordinatorLayout>
<AppBarLayout>

    <CollapsingToolbarLayout
       app:layout_scrollFlags="scroll|snap"
     >
        <FrameLayout/> <!-- fragment -->
         <Toolbar/> 
    </CollapsingToolbarLayout>

    <CollapsingToolbarLayout
       app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
     >
       <ImageView
         app:layout_collapseMode="parallax"
         app:layout_collapseParallaxMultiplier="0.04"
        />
       <Toolbar/><!-- Used to reach a minimum height -->
    </CollapsingToolbarLayout>

</AppbarLayout>

<RecyclerView
  app:layout_behavior="@string/appbar_scrolling_view_behavior"
>
</RecyclerView>


<ImageView
   app:layout_behavior="......CustomBehavior"
/></CoordinatorLayout>

When I use enterAlways or enterAlwaysCollapsed the imageview can be above toolbar but i want also the recyclerview scroll behind toolbar(second CollapsingToolbarLayout).

Upvotes: 0

Views: 414

Answers (1)

Lord_Gama
Lord_Gama

Reputation: 297

I feel like a fool, I currently solved it using the TranslationZ property, I thought it would not work in previous devices to the Api 21 and the toolbar would overcome everything, but i test it in a kitkat device and I saw it doesnt.

Upvotes: 1

Related Questions