android - Toolbar is displayed twice in coordinate layout fragment -
and used app:layout_scrollflags="scroll|enteralwayscollapsed"
but here toolbar transparent.

am using above xml layout fragment because requirement need different layout in fragment. appreciated.
toolbar issue in cordinatelayout
here code: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/detail_backdrop_height" android:theme="@style/themeoverlay.appcompat" android:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollflags="scroll|exituntilcollapsed" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginstart="48dp" app:expandedtitlemarginend="64dp"> <imageview android:id="@+id/backdrop_bannerimage_id" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="centercrop" android:fitssystemwindows="true" android:src="@drawable/grass_background" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/toolbar_event_home_id" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@drawable/cast_expanded_controller_actionbar_bg_gradient_light" app:popuptheme="@style/themeoverlay.appcompat.light" app:layout_collapsemode="parallax" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <android.support.v4.widget.nestedscrollview android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" app:cardusecompatpadding="true"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/event_name_text_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:gravity="center_horizontal" android:textsize="18sp" android:textstyle="bold" /> <textview android:id="@+id/event_date_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/event_name_text_view" android:layout_margin="10dp" android:text="21-08-2016" android:textsize="14sp" /> <textview android:id="@+id/event_attendee_count_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentend="true" android:layout_below="@+id/event_name_text_view" android:layout_margin="10dp" android:text="1000" android:textsize="14sp" /> <!-- <button android:id="@+id/event_book_now_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/event_date_text_view" android:layout_margin="15dp" android:background="@color/primary" android:text="book now" android:textcolor="@color/background_color" />--> <view android:id="@+id/event_info_view_line" android:layout_width="match_parent" android:layout_height="1dp" android:layout_below="@id/event_attendee_count_text_view" android:background="#cccccc" /> <linearlayout android:id="@+id/sub_linearlayout_1_day_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/event_info_view_line" android:layout_margin="15dp" android:orientation="horizontal"> <textview android:id="@+id/event_info_day_time_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/event_info_day_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginstart="10dp" android:text="21-08-2016" /> <!--<textview android:id="@+id/event_info_days_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2 days" android:layout_marginstart="150dp"/>--> </linearlayout> <linearlayout android:id="@+id/sub_linearlayout_2_place_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/sub_linearlayout_1_day_id" android:layout_marginstart="15dp"> <textview android:id="@+id/event_info_location_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/event_info_location_text_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginstart="10dp" android:text="21-08-2016" /> </linearlayout> <framelayout android:id="@+id/map_event_info" android:layout_width="match_parent" android:layout_height="150dp" android:layout_below="@id/sub_linearlayout_2_place_id" android:gravity="center" android:orientation="horizontal" android:padding="5dp"></framelayout> </relativelayout> </android.support.v7.widget.cardview> <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:elevation="10dp" app:cardusecompatpadding="true"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginbottom="@dimen/card_margin" android:layout_marginleft="@dimen/card_margin" android:layout_marginright="@dimen/card_margin" android:layout_margintop="@dimen/card_margin" android:orientation="vertical"> <textview android:id="@+id/event_info_details_header" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:text="details" android:textsize="16dp" android:textstyle="bold" /> <textview android:id="@+id/event_info_details_text_view" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp" /> </linearlayout> </android.support.v7.widget.cardview> </linearlayout> </android.support.v4.widget.nestedscrollview> <android.support.design.widget.floatingactionbutton android:id="@+id/floatingbuttoneventinfoid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginbottom="160dp" android:layout_gravity="bottom|end" android:layout_marginright="@dimen/fab_margin" android:visibility="invisible" app:elevation="6dp" app:pressedtranslationz="12dp" /> <android.support.design.widget.floatingactionbutton android:id="@+id/floatingbuttoneventinfofeedbackid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginbottom="90dp" android:layout_gravity="bottom|end" android:layout_marginright="@dimen/fab_margin" android:visibility="invisible" app:elevation="6dp" app:pressedtranslationz="12dp" /> <android.support.design.widget.floatingactionbutton android:id="@+id/floatingbuttoneventinfoshareid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" app:elevation="6dp" app:backgroundtint="@color/coloraccent" app:pressedtranslationz="12dp" android:layout_margin="@dimen/fab_margin" /> </android.support.design.widget.coordinatorlayout>
yours toolbar background messing yours collapsingtoolbarlayout
android:background="@drawable/cast_expanded_controller_actionbar_bg_gradient_light" try remove , run.
Comments
Post a Comment