android - SmoothAppBarLayout collapsed toolbar height is bigger than intended -


i changed appbarlayout smoothappbarlayout

it smoother , faster happy result. changed toolbar height somehow , couldn't yet fix it.

collapsed toolbar's height should 'actionbarsize' bigger that.

it not toolbar title, disabling or changing padding of doesnt work. behaviour.

setting new behavior below solves problem want proper solution.

    appbarlayout.behavior behavior = new appbarlayout.behavior();     params.setbehavior(behavior); 

first image shows intended size, second shows actual size.

intended collapsedtoolbar size results in bigger toolbar size

here part of xml: (didn't put of since pretty long)

    <me.henrytao.smoothappbarlayout.smoothappbarlayout         android:id="@+id/appbar"         android:layout_width="match_parent"         android:layout_height="210dp"         android:minheight="50dp"         android:theme="@style/themeoverlay.appcompat.dark.actionbar"         app:sabl_target_id="@id/nestedscrollview">          <android.support.design.widget.collapsingtoolbarlayout             android:id="@+id/collapsingtoolbarlayout"             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:background="@color/transparent"             android:fitssystemwindows="true"             android:minheight="210dp"             app:contentscrim="@color/dark_gray_actionbar"             app:layout_scrollflags="scroll|exituntilcollapsed">              <relativelayout                 android:layout_width="match_parent"                 android:layout_height="210dp"                 android:orientation="vertical"                 app:layout_collapsemode="parallax">                  <imageview                     android:id="@+id/serviceimage"                     android:layout_width="match_parent"                     android:layout_height="match_parent"                     android:contentdescription="servis fotoğrafı"                     android:scaletype="centercrop"                     android:src="@drawable/gray_color_gradient"                     app:layout_collapsemode="parallax" />             </relativelayout>              <android.support.v7.widget.toolbar                 android:id="@+id/toolbar"                 android:layout_width="match_parent"                 android:layout_height="?actionbarsize"                 android:layout_alignparenttop="true"                 android:layout_gravity="center_horizontal"                 app:layout_collapsemode="pin">              </android.support.v7.widget.toolbar>         </android.support.design.widget.collapsingtoolbarlayout>     </me.henrytao.smoothappbarlayout.smoothappbarlayout>      <include         layout="@layout/get_quote_layout"         android:layout_width="match_parent"         android:layout_height="64dp"         app:layout_anchor="@id/nestedscrollview"         app:layout_anchorgravity="bottom"         app:layout_collapsemode="pin" />   </android.support.design.widget.coordinatorlayout> 

i think issue comes fitsystemwindows. can simplify layout below:

... <me.henrytao.smoothappbarlayout.smoothappbarlayout     android:id="@+id/appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:theme="@style/themeoverlay.appcompat.dark.actionbar"     app:sabl_target_id="@id/nestedscrollview">      <android.support.design.widget.collapsingtoolbarlayout         android:id="@+id/collapsingtoolbarlayout"         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:background="@color/transparent"         app:contentscrim="@color/dark_gray_actionbar"         app:layout_scrollflags="scroll|exituntilcollapsed">          <relativelayout             android:layout_width="match_parent"             android:layout_height="210dp"             android:orientation="vertical"             app:layout_collapsemode="parallax">              <imageview                 android:id="@+id/serviceimage"                 android:layout_width="match_parent"                 android:layout_height="match_parent"                 android:contentdescription="servis fotoğrafı"                 android:scaletype="centercrop"                 android:src="@drawable/gray_color_gradient"                 app:layout_collapsemode="parallax" />         </relativelayout>          <android.support.v7.widget.toolbar             android:id="@+id/toolbar"             android:layout_width="match_parent"             android:layout_height="?actionbarsize"             android:layout_alignparenttop="true"             android:layout_gravity="center_horizontal"             app:layout_collapsemode="pin">          </android.support.v7.widget.toolbar>     </android.support.design.widget.collapsingtoolbarlayout> </me.henrytao.smoothappbarlayout.smoothappbarlayout> ... 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -