i trying implement layout there parallax image on top collapse when user scrolls. thought coordinatorlayout perfect match requirement.
however part of design show list of items, thought recyclerview best suited task.
for reason can't make individual content of recycler view show when height set wrap_content. if set height match_parent each item takes full height of recycler view that's not what's required.
below layout xml file
<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context="com.example.fragments.search.userprofilefragment"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="@dimen/interested_in_profile_picture_height" android:fitssystemwindows="false" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <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:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="48dp" app:layout_scrollflags="scroll|exituntilcollapsed"> <imageview android:id="@+id/profile_picture" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:scaletype="centercrop" app:layout_collapsemode="parallax" /> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:layout_collapsemode="pin" app:popuptheme="@style/mytheme"> <imageview android:id="@+id/nav_back_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:layout_gravity="right" android:layout_marginright="@dimen/small_margin" android:scaletype="centerinside" android:src="@drawable/nav_back" /> </android.support.v7.widget.toolbar> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <android.support.v4.widget.nestedscrollview android:id="@+id/nested_scroll_view" android:layout_width="match_parent" android:layout_height="match_parent" android:fillviewport="true" android:scrollbars="none" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white" android:orientation="vertical" android:padding="@dimen/medium_padding"> <fr.arnaudguyon.smartfontslib.fonttextview android:id="@+id/name" style="@style/formlabelblack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity="right" android:padding="@dimen/xtra_small_padding" /> <view android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/overlaywithalpha_black" /> <fr.arnaudguyon.smartfontslib.fonttextview android:id="@+id/occupation" style="@style/formlabelblackthin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity="right" android:padding="@dimen/xtra_small_padding" /> <textview android:id="@+id/age" style="@style/formlabelblack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity="right" android:padding="@dimen/xtra_small_padding" android:text="@string/age_placeholder" /> <view android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/overlaywithalpha_black" /> <fr.arnaudguyon.smartfontslib.fonttextview android:id="@+id/biolabel" style="@style/formlabelblack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity="right" android:text="@string/biography_title" /> <fr.arnaudguyon.smartfontslib.fonttextview android:id="@+id/bio" style="@style/formlabelblackthin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="@dimen/xtra_small_padding" /> <view android:id="@+id/interests_separator" android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/overlaywithalpha_black" /> <fr.arnaudguyon.smartfontslib.fonttextview android:id="@+id/interests_title" style="@style/formlabelblack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:gravity="right" android:padding="@dimen/xtra_small_padding" android:text="@string/interests_title" /> <android.support.v7.widget.recyclerview android:id="@+id/interests" android:layout_width="match_parent" android:layout_height="wrap_content" android:fillviewport="true" android:layout_gravity="right" android:gravity="right" android:padding="@dimen/xtra_small_padding" /> </linearlayout> </android.support.v4.widget.nestedscrollview> <include layout="@layout/actions" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/black" app:layout_anchor="@id/nested_scroll_view" app:layout_anchorgravity="bottom|right|end" /> </android.support.design.widget.coordinatorlayout>
what issue?
Comments
Post a Comment