android - Collapsing Toolbar Title Disappear -
i'm on design support library 23.0.1, , i'm using collapsing toolbar layout parallax image. don't understand why when toolbar totally collapsed (pinned) if click on action button (specifically refresh image), title disappear. after if drop down header total expansion , reclick action button title returns.
activity layout
<!-- app bar --> <android.support.design.widget.appbarlayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="150dp" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <!-- collapsing toolbar layout --> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginbottom="32dp" app:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="48dp" app:layout_scrollflags="scroll|exituntilcollapsed"> <!-- image parallax --> <imageview android:id="@+id/header" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustviewbounds="true" android:contentdescription="" android:fitssystemwindows="true" android:scaletype="centercrop" edo:layout_collapsemode="parallax" /> <!-- toolbar --> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:layout_collapsemode="pin" edo:popuptheme="@style/themeoverlay.appcompat.light"> </android.support.v7.widget.toolbar> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <!-- nested scroll view --> <android.support.v4.widget.nestedscrollview android:id="@+id/nested_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" edo:layout_behavior="@string/appbar_scrolling_view_behavior"> </android.support.v4.widget.nestedscrollview>
action menu layout
<item android:id="@+id/action_bookmark" android:icon="@mipmap/bookmark_empty_white" android:title="@string/add_news_to_bookmarks" app:showasaction="ifroom" />
options selected
@override public boolean onoptionsitemselected(menuitem item) { if (news != null) { switch (item.getitemid()) { case r.id.action_bookmark: if (utils.isnetworkavailable(activity)) { if (news.getbookmarked()) { bookmarked = false; item.seticon(r.mipmap.bookmark_empty_white); deletebookmark(); } else { bookmarked = true; item.seticon(r.mipmap.bookmark_white); postbookmark(); } } else { handleerror(config.api_err_connection); } return true; } } return super.onoptionsitemselected(item); }
this bug @ android's side. aware of , looks fixed in future release: https://code.google.com/p/android/issues/detail?id=183333
workarounds posted in link none have been able fix issue.
edit: issue has been fixed support library v23.1.0
Comments
Post a Comment