how to put a transparent layout above floating action button - android

I am working on an app and i want to put a transparent view over whole screen and i have gained success on this by some percent but my screen contains floating action buttons also
I am unable to put the transparent layout above floating action button
this is my xml
<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:id="#+id/root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.groomefy.consumer.Trending.DetailedActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="370dp"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:id="#+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-10dp"
app:layout_collapseMode="parallax">
<ImageView
android:id="#+id/main_image"
android:layout_width="match_parent"
android:layout_height="430dp"
android:scaleType="fitEnd"
android:src="#drawable/image_placeholder_square" />
<!--
<ImageView
android:id="#+id/curve_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_marginBottom="-20dp"
android:scaleType="fitEnd"
android:src="#drawable/postdetail_curve"
app:layout_anchor="#id/main_image"
app:layout_collapseMode="none" />
-->
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/white"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<ImageButton
android:id="#+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="#android:color/transparent"
android:padding="10dp"
android:src="#drawable/backicon" />
<com.groomefy.consumer.fontutils.OpenSansBold
android:id="#+id/title_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="#string/fragment_blogs"
android:textColor="#color/title_text_color"
android:textSize="#dimen/title_text_size"
android:textStyle="bold" />
<ImageView
android:id="#+id/iv_more"
android:layout_width="#dimen/more_btn_height"
android:layout_height="#dimen/more_btn_height"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:scaleType="center"
android:src="#drawable/more" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#a6a6a6" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nested_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_root_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardBackgroundColor="#color/white">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="35dp"
android:gravity="left"
android:orientation="vertical"
android:padding="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="#+id/likes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="likes"
android:textSize="16sp" />
<TextView
android:id="#+id/comments"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_toRightOf="#+id/likes"
android:text="comments"
android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.groomefy.consumer.fontutils.OpenSansRegular
android:id="#+id/blog_main_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="di am first #firsttag i am second #secondtag and i am third #thirtag di am first #firsttag i am second #secondtag and i am third #thirtag di am first #firsttag i am second #secondtag and i am third #thirtag di am first #firsttag i am second #secondtag and i am third #thirtag"
android:textSize="15sp" />
<com.groomefy.consumer.fontutils.OpenSansRegular
android:id="#+id/time_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/blog_main_text"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:text="this is time text "
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:id="#+id/header_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<FrameLayout
android:id="#+id/fl_profile_pic"
android:layout_width="45dp"
android:layout_height="45dp">
<ImageView
android:id="#+id/image_view_profile"
android:layout_width="#dimen/list_user_pro_img_radius"
android:layout_height="#dimen/list_user_pro_img_radius"
android:layout_marginLeft="3dp"
android:background="#color/grey_3"
android:scaleType="center"
android:src="#drawable/profile_placeholder_g" />
<ImageView
android:layout_width="48dp"
android:layout_height="#dimen/list_user_pro_img_radius"
android:background="#drawable/profile_placeholder_top_layer"
android:scaleType="fitXY" />
</FrameLayout>
<com.groomefy.consumer.fontutils.OpenSansBold
android:id="#+id/text_view_blogger_name"
style="#style/black.regular"
android:layout_centerVertical="true"
android:layout_marginLeft="#dimen/mar_hor_regular"
android:layout_toRightOf="#+id/fl_profile_pic"
android:gravity="top"
android:text="Jaine Helor" />
</RelativeLayout>
<com.groomefy.consumer.fontutils.OpenSansBold
android:id="#+id/get_similar_suggestions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:background="#drawable/text_rectangle"
android:gravity="center"
android:padding="2dp"
android:text="Get Similar Suggestions"
android:textAllCaps="true"
android:textColor="#color/title_text_color"
android:textStyle="bold" />
</LinearLayout>
</android.support.v7.widget.CardView>
</android.support.v4.widget.NestedScrollView>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<View
android:id="#+id/tranparent_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_very_light_semi_transparent"
android:elevation="15dp"
android:fitsSystemWindows="true"
android:visibility="gone" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/like_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="80dp"
android:background="#color/white"
android:elevation="10dp"
android:src="#drawable/like"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|center_vertical" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fav_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="10dp"
android:src="#drawable/add_to_stylebook"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|center" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/share_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="70dp"
android:elevation="10dp"
android:src="#drawable/share"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|right" />
<LinearLayout
android:id="#+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="true"
android:fitsSystemWindows="true"
android:orientation="vertical"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<android.support.v7.widget.CardView
android:id="#+id/card_view_sharing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:cardBackgroundColor="#color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.groomefy.consumer.fontutils.OpenSansBold
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/grey_very_light"
android:gravity="center"
android:padding="5dp"
android:text="#string/share_this_look"
android:textAllCaps="true"
android:textColor="#color/black_text"
android:textSize="#dimen/sharing_text_size" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:padding="10dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/share_on_facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/facebook" />
<com.groomefy.consumer.fontutils.OpenSansRegular
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Facebook"
android:textSize="#dimen/sharing_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/share_on_whatsapp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/whatsapp" />
<com.groomefy.consumer.fontutils.OpenSansRegular
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="whatsapp"
android:textSize="#dimen/sharing_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/share_on_instagram"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/instagram" />
<com.groomefy.consumer.fontutils.OpenSansRegular
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Instagram"
android:textSize="#dimen/sharing_text_size" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
I have tried to fix this by elevation but failed to achieve this
can anyone please suggest me what should be the approach to put the layout above floating action button

add this line in your transparent view:
android:translationZ="8dp"

Android Layouts are Z - ordered ie., a layout defined after another will be on top of it visually. Add your transparent view after the container that holds the FAB, that way your transparent view will be on top of the FAB and effectively gets drawn over it.

Define your transparent layout after FAB. Like this -
<android.support.design.widget.FloatingActionButton
android:id="#+id/like_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="80dp"
android:background="#color/white"
android:elevation="10dp"
android:src="#drawable/like"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|center_vertical" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fav_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:elevation="10dp"
android:src="#drawable/add_to_stylebook"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|center" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/share_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="70dp"
android:elevation="10dp"
android:src="#drawable/share"
app:fabSize="normal"
app:layout_anchor="#id/app_bar"
app:layout_anchorGravity="bottom|right" />
<View
android:id="#+id/tranparent_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_very_light_semi_transparent"
android:elevation="15dp"
android:fitsSystemWindows="true"
android:visibility="gone" />

Related

Space between the View pager and tabLayout which is inside collpasing toolbar

Some empty space is shown after tab Layout. I have the view pager outside the app bar layout and tab layout inside the Relative Layout which is inside of collapsing toolbar. Not able to determine from where this extra space is added. Any help would be appreciated. The hierarchy of the views is Coordinator, App Bar, Collapsing Toolbar, Frame Layout, Relative Layout, Tab Layout.
Below is the 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"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_bg"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="500dp"
android:background="?attr/colorPrimary">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="#style/TextAppearance.AppCompat.Title"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:titleEnabled="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_collapseMode="parallax">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/header_picture"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#drawable/splash"
android:orientation="horizontal"
android:visibility="visible" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:id="#+id/tv_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="60dp"
android:text="Kunal Bagla"
android:textColor="#android:color/black"
android:textSize="19dp" />
<TextView
android:id="#+id/tv_profile_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv_profile_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="Udaipur"
android:textColor="#android:color/black"
android:textSize="15dp" />
<TextView
android:id="#+id/tv_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="#drawable/black_border_rounded"
android:gravity="right"
android:paddingBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp"
android:text="Settings"
android:textColor="#android:color/black"
android:textSize="15dp"
android:visibility="visible" />
<android.support.design.widget.TabLayout
android:id="#+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/tv_profile_location"
android:layout_marginTop="10dp"
app:tabIndicatorColor="#color/orange"
/>
</RelativeLayout>
</LinearLayout>
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/drawee_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center|left"
android:layout_marginLeft="20dp"
fresco:placeholderImage="#drawable/home_bg"
fresco:placeholderImageScaleType="centerCrop"
fresco:roundAsCircle="true" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_marginLeft="110dp">
<TextView
android:id="#+id/drawee_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="camera"
android:textAlignment="center"
android:textColor="#color/whiteColor"
android:textSize="12sp" />
</FrameLayout>
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/orange"
app:layout_collapseMode="pin"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
<LinearLayout
android:id="#+id/ll_sub_main_dice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/menu_icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="5dp" />
<Button
android:id="#+id/button_app_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/tv_login_logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:padding="5dp" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
Some empty space is shown after tab Layout.
Specyfy what u meen ( is there inside of tab layout or outside the best print printscreen)
Is there only in 1 place this extra space or in all AppBarLayout
And u modify in activities those items?
I woud check first behavior those layout at solo and add 1 by 1 next items and then u probly see what's wrong and abou
Here is the solution if required by some one else. If you want your toolbar to be fixed and content to be scrolled under use collapse mode as pin for toolbar and scrollFlags as scroll|exitAlwaysCollapsed for collapsing toolbar
<?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"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:id="#+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_bg"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="#style/TextAppearance.AppCompat.Title"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
app:titleEnabled="false">
<android.support.constraint.ConstraintLayout
android:id="#+id/parentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="#+id/image_view_product"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/splash" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/drawee_avatar"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center|left"
android:layout_marginLeft="20dp"
android:layout_marginTop="100dp"
app:layout_constraintBottom_toBottomOf="#+id/image_view_product"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="#+id/image_view_product"
fresco:placeholderImage="#drawable/home_bg"
fresco:placeholderImageScaleType="centerCrop"
fresco:roundAsCircle="true" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|left"
android:layout_marginLeft="110dp"
android:visibility="visible">
<TextView
android:id="#+id/drawee_camera"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="8dp"
android:text="camera"
android:textAlignment="center"
android:textColor="#color/whiteColor"
android:textSize="12sp" />
</FrameLayout>
<TextView
android:id="#+id/tv_profile_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginStart="15dp"
android:layout_marginTop="70dp"
android:text="XYZ"
android:textColor="#android:color/black"
android:textSize="19dp"
app:layout_constraintTop_toBottomOf="#id/image_view_product" />
<TextView
android:id="#+id/tv_profile_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/tv_profile_name"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="Location"
android:textColor="#android:color/black"
android:textSize="15dp"
app:layout_constraintTop_toBottomOf="#+id/tv_profile_name" />
<TextView
android:id="#+id/tv_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:background="#drawable/black_border_rounded"
android:gravity="right"
android:paddingBottom="10dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingTop="10dp"
android:text="Settings"
android:textColor="#android:color/black"
android:textSize="15dp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="#id/image_view_product" />
<android.support.design.widget.TabLayout
android:id="#+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="#+id/tv_profile_location"
android:layout_below="#+id/tv_profile_location"
android:layout_marginTop="10dp"
app:tabIndicatorColor="#color/orange" />
</android.support.constraint.ConstraintLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/orange"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="parallax">
<LinearLayout
android:id="#+id/ll_sub_main_dice"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="#+id/menu_icon_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:padding="5dp" />
<Button
android:id="#+id/button_app_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:gravity="center_horizontal" />
<TextView
android:id="#+id/tv_login_logout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="right"
android:padding="5dp" />
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" /></android.support.design.widget.CoordinatorLayout>

How to add CardView to a Navigation Drawer Activity?

I have been trying to add CardView to navigationDrawer activity and collapsing toolbar layout all in one activity so that I can view all my contents form navigation drawer and collapse the layout and use card view as my buttons to make it more attractive. but it works fine as long as I don't add card views into the layout, but when I add the CardView into the code that is XML file and run the program the emulator shows that the app has not responding.
I need help with this, please anyone.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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:id="#+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.madhu.management.DashBoard">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e0e0e0">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="250dp"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingtoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/materialappbar"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="480dp"
app:layout_scrollFlags="exitUntilCollapsed|scroll"
app:title="management">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarid"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</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:id="#+id/ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fcfcfc"
android:gravity="center"
android:orientation="vertical"
android:padding="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:id="#+id/bankcardId"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="#drawable/circlebackgroundpurple"
android:padding="10dp"
android:src="#drawable/ic_add_alert_white_24px" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Notice"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="department notice board"
android:textColor="#android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="#drawable/circlebackgroundpink"
android:padding="10dp"
android:src="#drawable/ic_book_white_24px" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Notes"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="Notes from faculty"
android:textColor="#android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="#drawable/circlebackgroundgreen"
android:padding="10dp"
android:src="#drawable/ic_help_outline_white_24px" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Question papers"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="Question banks and question papers"
android:textColor="#android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="#drawable/circlebackgroundyellow"
android:padding="10dp"
android:src="#drawable/ic_update_white_24px" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="University Updates"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="updates from university"
android:textColor="#android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="340dp"
android:layout_height="150dp"
android:layout_margin="10dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="#drawable/circlebackgroundpurple"
android:padding="10dp"
android:src="#drawable/ic_stars_white_24dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Results"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="#color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="semister results"
android:textColor="#android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#ffffff"
app:headerLayout="#layout/header"
app:itemIconTint="#color/colorPrimaryDark"
app:itemTextColor="#color/colorPrimaryDark"
app:menu="#menu/drawermenu" />
</android.support.v4.widget.DrawerLayout>

To disable scrolling in TabLayout fragment in CollapsingToolbar

I have a screen with CollapsingToolbar and below I have a TabLayout with some fragments.
One such fragment has data retrieved with RecyclerView.
The problem is when the screen shrinks the fragment that has the RecyclerView scrolls together and delays the CollapsingToolbar, giving an unwanted effect.
Is there any way I can block the Scroll of the fragment until CollapsingToolbar finishes the process and collapses completely?
Link Gif Sample
Code Activity:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="#dimen/app_bar_height"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="#color/cinzaMEdio"
app:expandedTitleGravity="bottom"
android:background="#android:color/white"
app:expandedTitleMarginBottom="170dp"
app:expandedTitleMarginStart="10dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="225dp">
<ImageView
android:id="#+id/main.backdrop"
android:layout_width="match_parent"
android:layout_height="#dimen/nav_header_height"
android:fitsSystemWindows="true"
android:src="#drawable/hair"
app:layout_collapseMode="parallax"
android:adjustViewBounds="true"
android:cropToPadding="false"
android:scaleType="fitXY"
/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="225dp"
android:background="#drawable/gradient_bg">
</FrameLayout>
<TextView
android:id="#+id/tvPerEmpNome"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="10dp"
android:layout_marginBottom="28dp"
android:text="Firma X"
android:textColor="#android:color/white"
android:textSize="24sp"
app:layout_collapseMode="parallax"
android:textStyle="bold"/>
<TextView
android:id="#+id/tvNomeCidade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="10dp"
android:layout_marginStart="10dp"
android:text="São Paulo - SP"
android:textColor="#android:color/white"
android:textSize="14sp"
app:layout_collapseMode="parallax" />
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="120dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="horizontal"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<LinearLayout
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:clickable="true"
android:background="#drawable/ripple_menus_perfil_empresa">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="#drawable/ic_person_add"
android:baselineAlignBottom="false"
android:clickable="true"
android:cropToPadding="false"
android:scaleType="centerCrop"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="5dp"
android:text="Seguir"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:clickable="true"
android:background="#drawable/ripple_menus_perfil_empresa">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="#drawable/ic_star_half"
android:baselineAlignBottom="false"
android:clickable="true"
android:cropToPadding="false"
android:scaleType="centerCrop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="5dp"
android:text="Avaliações"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:clickable="true"
android:background="#drawable/ripple_menus_perfil_empresa">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="#drawable/ic_photo"
android:baselineAlignBottom="false"
android:clickable="true"
android:cropToPadding="false"
android:scaleType="centerCrop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="5dp"
android:text="Fotos"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:clickable="true"
android:background="#drawable/ripple_menus_perfil_empresa">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:adjustViewBounds="true"
android:background="#drawable/ic_business"
android:baselineAlignBottom="false"
android:clickable="true"
android:cropToPadding="false"
android:scaleType="centerCrop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingTop="5dp"
android:text="Sobre"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginBottom="65dp"
android:orientation="horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Agendar"
android:textSize="16sp"
android:textAlignment="center"
android:background="#drawable/ripple_button_border_black"
android:textColor="#android:color/black"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:clickable="true"
android:paddingBottom="5dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginLeft="5dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Mensagem"
android:textAlignment="center"
android:textSize="16sp"
android:background="#drawable/ripple_button_black"
android:textColor="#android:color/white"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:clickable="true"
android:paddingBottom="5dp"/>
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarPerfilEmpresa"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:layout_marginBottom="48dp"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|enterAlways" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_gravity="bottom|end"
android:layout_marginBottom="48dp"
android:background="#color/cinza300"
app:layout_collapseMode="parallax" />
<android.support.design.widget.TabLayout
android:id="#+id/tabs_perf_emp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#color/cinzaMEdio"
app:layout_collapseMode="pin"
app:tabTextAppearance="#style/MineCustomTabText">
</android.support.design.widget.TabLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nestedScrollViewContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffff0d02"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.view.ViewPager
android:id="#+id/pager_tabs_perf_emp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:minHeight="600dp"
android:layout_weight="1"
android:background="#color/cinza300"
/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Code Fragment:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/cardFeedUser_list" />
</RelativeLayout>
You must use setNestedScrollingEnabled(false) for cardFeedUser_list recyclerView
If you are using API > 21
recyclerView.setNestedScrollingEnabled(false)
If you are using API < 21
ViewCompat.setNestedScrollingEnabled(recyclerView, true);
for the support library, you can easily control your app bar visibility.
setExpanded(true,true);
or
setExpanded(false,true);
Also, you can use DragCallback Method
private void setDragCallback() {
setDragCallback(new DragCallback() {
#Override
public boolean canDrag(#NonNull AppBarLayout appBarLayout) {
return mEnabled;
}
});
}
Solution. Removed NestedScrollView
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/pager_tabs_perf_emp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minHeight="600dp"
android:layout_weight="1"
android:background="#color/cinza300"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
/>
</android.support.design.widget.CoordinatorLayout>

NestedScrollView doesnt show cards with wrap content and dynamic data

I have an activity with view pager and I'm loading fragments which has NestedScrollView as parent with cards in it. The data in the card is loaded dynamically and doesn't have fixed height. The card's height is set to wrap_content.
The problem is that the NestedScrollView is not displaying the cards properly after the data is loaded. In some cases the cards overlap each other, while in some, the cards are not visible at all (usually the last).
The activity:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/activity_generic_candidate_profile"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.interviewair.interviewairforemployer.ui.genericCandidateProfile.GenericCandidateProfileActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbarlayout_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingtoolbar_genericcandidateprofile"
android:layout_width="match_parent"
android:layout_height="300dp"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="#android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="150dp">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.5"
android:background="#color/black" />
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="#drawable/ic_play_circle_outline_black_24px"
android:tint="#color/white"
android:elevation="10dp"
android:alpha="0.7"
android:layout_gravity="center"/>
</FrameLayout>
<de.hdodenhof.circleimageview.CircleImageView
android:id="#+id/circleimageview_genericcandidateprofile_photo"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="#dimen/margin_10"
android:src="#drawable/ic_person_outline_white_48px"
app:civ_border_color="#color/white"
app:civ_border_width="1.5dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="30dp"
android:layout_marginStart="#dimen/margin_10"
android:orientation="vertical">
<TextView
android:id="#+id/textview_genericcandidateprofile_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_5"
android:drawablePadding="#dimen/padding_5"
android:gravity="center_vertical"
android:textColor="#color/white"
android:textSize="#dimen/di_text_medium"
android:textStyle="bold" />
<TextView
android:id="#+id/textview_genericcandidateprofile_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_5"
android:alpha="0.8"
android:drawableLeft="#drawable/ic_work_black_18dp"
android:drawablePadding="#dimen/padding_5"
android:gravity="center_vertical"
android:textColor="#color/white"
android:textSize="#dimen/di_text_regular" />
<TextView
android:id="#+id/textview_genericcandidateprofile_location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_5"
android:alpha="0.8"
android:drawableLeft="#drawable/ic_location_on_black_18px"
android:drawablePadding="#dimen/padding_5"
android:gravity="center_vertical"
android:text="Mumbai, Maharashtra"
android:textColor="#color/white"
android:textSize="#dimen/di_text_regular" />
</LinearLayout>
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_genericcandidateprofile"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="#+id/tablayout_genericcandidateprofile_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="pin"
app:tabGravity="fill"
app:tabIndicatorColor="#color/white"
app:tabIndicatorHeight="5dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="#color/white"
app:tabTextColor="#color/grey500" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager_genericcandidateprofile_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="#dimen/fab_margin"
android:layout_marginBottom="#dimen/fab_margin"
app:borderWidth="0dp"
app:elevation="6dp"
app:pressedTranslationZ="12dp"
android:clickable="true"
app:rippleColor="#color/colorPrimary"
android:src="#drawable/ic_dashboard_white_24px"/>
</android.support.design.widget.CoordinatorLayout>
The fragment that is being loaded:
<android.support.v7.widget.CardView
android:id="#+id/cardview_overview_skills"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/margin_5">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="#dimen/padding_10">
<TextView
android:id="#+id/textview_overview_skilltitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="#dimen/padding_5"
android:gravity="center_vertical"
android:text="#string/text_skills"
android:textColor="#color/colorPrimary"
android:textSize="#dimen/di_text_regular" />
<com.dpizarro.autolabel.library.AutoLabelUI
android:id="#+id/autolabel_overview_skillchips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textview_overview_skilltitle"
android:layout_marginTop="#dimen/margin_10"
autolabel:label_background_res="#drawable/custom_rounded_background"
autolabel:label_clickable="false"
autolabel:show_cross="false"
autolabel:text_color="#android:color/black"
autolabel:text_size="#dimen/di_text_small" />
<ImageView
android:id="#+id/imageview_overview_retry_skills"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:background="#drawable/custom_button_grey_background"
android:src="#drawable/ic_refresh_black_24px"
android:tint="#color/colorAccent"
android:visibility="gone" />
<ProgressBar
android:id="#+id/progressbar_overview_skillpb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="gone" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_overview_preferredlocation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/cardview_overview_skills"
android:layout_margin="#dimen/margin_5">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="#dimen/padding_10">
<TextView
android:id="#+id/textview_overview_loctitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/text_preferred_location"
android:textColor="#color/colorPrimary"
android:textSize="#dimen/di_text_regular" />
<com.dpizarro.autolabel.library.AutoLabelUI
android:id="#+id/autolabel_overview_preflocchips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/textview_overview_loctitle"
android:layout_marginTop="#dimen/margin_10"
autolabel:label_background_res="#drawable/custom_rounded_background"
autolabel:label_clickable="false"
autolabel:show_cross="false"
autolabel:text_color="#android:color/black"
autolabel:text_size="#dimen/di_text_small" />
<ImageView
android:id="#+id/imageview_overview_retry_loc"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:background="#drawable/custom_button_grey_background"
android:src="#drawable/ic_refresh_black_24px"
android:tint="#color/colorAccent"
android:visibility="gone" />
<ProgressBar
android:id="#+id/progressbar_overview_locpb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:indeterminate="true"
android:visibility="gone" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/cardview_overview_personal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/cardview_overview_eduexp"
android:layout_margin="#dimen/margin_5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="#dimen/padding_5">
<TextView
android:id="#+id/textview_overview_personaltitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="#dimen/padding_5"
android:gravity="center_vertical"
android:text="#string/text_personal"
android:textColor="#color/colorPrimary"
android:textSize="#dimen/di_text_regular" />
<LinearLayout
android:id="#+id/linearlayout_overview_personalwrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="#dimen/margin_5"
android:layout_marginTop="#dimen/margin_10"
android:orientation="vertical"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="#string/text_email"
android:textColor="#color/grey700"
android:textSize="#dimen/di_text_regular" />
<TextView
android:id="#+id/textview_overview_email"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:textSize="#dimen/di_text_regular" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_5"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="#string/text_mobile"
android:textColor="#color/grey700"
android:textSize="#dimen/di_text_regular" />
<TextView
android:id="#+id/textview_overview_mobile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:textSize="#dimen/di_text_regular" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_5"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="#string/text_dob"
android:textColor="#color/grey700"
android:textSize="#dimen/di_text_regular" />
<TextView
android:id="#+id/textview_overview_dob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:textSize="#dimen/di_text_regular" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_5"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="75dp"
android:layout_height="wrap_content"
android:text="#string/text_gender"
android:textColor="#color/grey700"
android:textSize="#dimen/di_text_regular" />
<TextView
android:id="#+id/textview_overview_gender"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/black"
android:textSize="#dimen/di_text_regular" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="#+id/imageview_overview_retry_personal"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="center"
android:background="#drawable/custom_button_grey_background"
android:src="#drawable/ic_refresh_black_24px"
android:tint="#color/colorAccent"
android:visibility="gone" />
<ProgressBar
android:id="#+id/progressbar_overview_personalpb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:visibility="gone" />
</LinearLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>

android : NestedScrollview bottom two button attached

I am trying to create Android product layout. In footer have two buttons it is fixed button. you can see images when I am scrolling up bottom two buttons attached in my layout. Please help how can i do?
Image 1
Image 2
after scrolling
xml
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/coordinate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.chivazo.chivazoandroid.activities.SingleProductActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="#dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginBottom="30dp"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="#drawable/a"
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/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_single_product" />
<LinearLayout
android:id="#+id/groupbutton"
android:weightSum="2"
android:orientation="horizontal"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v7.widget.AppCompatButton
android:layout_weight="1"
android:id="#+id/share"
android:text="share"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<android.support.v7.widget.AppCompatButton
android:layout_weight="1"
android:id="#+id/go_wishlist"
android:text="go to Wishlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
You can use Relativelayout as your outer layout and keep CoordinatorLayout inside it, make Two buttons android:layout_alignParentBottom="true"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="vertical">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/groupbutton"
android:fitsSystemWindows="true"
tools:context="com.chivazo.chivazoandroid.activities.SingleProductActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="#dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginBottom="30dp"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="#drawable/a"
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/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_single_product" />
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:id="#+id/groupbutton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:orientation="horizontal"
android:weightSum="2">
<android.support.v7.widget.AppCompatButton
android:id="#+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="share" />
<android.support.v7.widget.AppCompatButton
android:id="#+id/go_wishlist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="go to Wishlist" />
</LinearLayout>
</RelativeLayout>
The app:layout_anchor="#id/anchor_view"
and
app:layout_anchorGravity="bottom"
are the Important attributes here
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".ProductDetailActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="#color/colorPrimary"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nested_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
.
.
.
<View
android:id="#+id/anchor_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
.
.
.
.
</android.support.v4.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_anchor="#id/anchor_view"
app:layout_anchorGravity="bottom">
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Simply add your layout in Coordinatorlayout below NestedScrollView in xml and do the following in java.
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) layoutToBeAnchored.getLayoutParams();
layoutParams.setAnchorId(R.id.layoutBelowWhichToBeAnchored);
layoutParams.anchorGravity = Gravity.CENTER;
layoutToBeAnchored.setLayoutParams(layoutParams);
Hope this helps you guys. For any reference you can check the example at -
https://github.com/IsUncommon/Droidcon-India-2015
If your included layout layout="#layout/content_single_product" contains a NestedScrollView as a root view container. Try to add an id to it like #+id/nestedView with android:layout_height="match_parent", You must probably add bottom padding with the same height value of your buttons , and Just keep the rest as it is, and replace android:layout_gravity="bottom" inside your bottom linear layout which contains the two buttons with :
app:layout_anchor="#id/nestedView"
app:layout_anchorGravity="bottom"
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:background="#android:color/transparent"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="center_vertical|start"
app:expandedTitleTextAppearance="#android:color/transparent"
app:layout_collapseMode="parallax"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:id="#+id/lay_image_slider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/browseCategories"
android:background="#color/white">
<FrameLayout
android:id="#+id/rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"
android:orientation="vertical">
<com.example.android_dev.ecm.View.ViewPagerCustomDuration
android:id="#+id/pager"
android:layout_width="fill_parent"
android:layout_height="300dp" />
<com.example.android_dev.ecm.View.CirclePageIndicator
android:id="#+id/indicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#android:color/transparent"
android:padding="10dp" />
</FrameLayout>
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbarSeller"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="56dp"
app:layout_collapseMode="pin" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<include
android:id="#+id/contentScroll"
layout="#layout/content_scroll_product_detail" />
</android.support.design.widget.CoordinatorLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_gravity="center"
android:background="#drawable/shadow" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="#+id/addToCart"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/white"
android:text="Add To Cart"
android:textColor="#color/black"
android:textSize="16sp" />
<!--<Button
android:id="#+id/addToWishList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/colorAccent"
android:text="Add To Wishlist"
android:textColor="#color/white" />-->
<Button
android:id="#+id/buyNow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/colorPrimary"
android:text="Buy Now"
android:textColor="#color/white"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
content_scroll_product_detail.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:expandableTextView="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="com.example.android_dev.ecm.Helper.FixedScrollingViewBehaviour">
<android.support.v4.widget.NestedScrollView
android:id="#+id/nestedScroll"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/productDetails"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="#+id/productTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:textColor="#color/black"
android:textSize="18sp" />
<TextView
android:id="#+id/productName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="2dp"
android:textSize="16sp" />
<RelativeLayout
android:id="#+id/priceLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="#+id/productDiscountPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:textColor="#color/black"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="#+id/productPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="#+id/productDiscountPrice"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:textColor="#color/gray"
android:textSize="14sp" />
<LinearLayout
android:id="#+id/ratingProduct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:orientation="horizontal">
<TextView
android:id="#+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:padding="10dp"
android:text="3.2"
android:textColor="#color/colorAccent"
android:textSize="22sp" />
<RatingBar
android:id="#+id/star"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="#+id/rating"
android:isIndicator="true"
android:numStars="1"
android:rating="1" />
</LinearLayout>
<LinearLayout
android:id="#+id/sold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/productPrice"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Sold by : "
android:textColor="#color/gray"
android:textSize="14sp" />
<TextView
android:id="#+id/soldBy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#color/gray"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="#+id/orders"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/sold"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:text="Additional tax may apply charged at checkout"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="10dp"
android:weightSum="1">
<Button
android:id="#+id/share"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:background="#drawable/lay_border"
android:drawableLeft="#drawable/shareic"
android:drawablePadding="-20dp"
android:gravity="center"
android:paddingLeft="8dp"
android:text="Share"
android:textColor="#color/black" />
<Button
android:id="#+id/addToWishList"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:background="#drawable/lay_border"
android:drawableLeft="#drawable/pinic"
android:drawablePadding="-10dp"
android:gravity="center"
android:paddingLeft="8dp"
android:text="Add To Pinlist"
android:textColor="#color/black" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/ratingSeller"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/productDetails">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp">
</RelativeLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="#+id/outOfStock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/ratingSeller"
android:background="#color/light_red"
android:gravity="center"
android:text="Sorry this product is out of stock."
android:textColor="#color/white"
android:textSize="22sp"
android:visibility="gone" />
<android.support.v7.widget.CardView
android:id="#+id/productVariants"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/outOfStock"
android:layout_marginTop="5dp">
<LinearLayout
android:id="#+id/addAttributesHere"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:id="#+id/saveButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/productVariants"
android:orientation="horizontal"
android:visibility="gone"
android:weightSum="2">
<Button
android:id="#+id/add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/black"
android:text="Add To Cart"
android:textColor="#color/white" />
<!-- <Button
android:id="#+id/save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/colorAccent"
android:text="Add To Wishlist"
android:textColor="#color/white" />-->
<Button
android:id="#+id/buyNow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="#color/colorAccent"
android:text="Buy Now"
android:textColor="#color/white" />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="#+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/saveButtons"
android:layout_marginTop="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="Description"
android:textColor="#color/black"
android:textSize="16sp"
android:textStyle="bold" />
<com.ms.square.android.expandabletextview.ExpandableTextView
android:id="#+id/expand_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
expandableTextView:animDuration="200"
expandableTextView:maxCollapsedLines="2">
<TextView
android:id="#+id/expandable_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:textColor="#color/black"
android:textSize="14sp" />
<ImageButton
android:id="#id/expand_collapse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:background="#android:color/transparent"
android:padding="16dp" />
</com.ms.square.android.expandabletextview.ExpandableTextView>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/recommend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/description"
android:layout_marginTop="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/white">
<TextView
android:id="#+id/recommendHead"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="Recommendation"
android:textColor="#color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/recommendText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/recommendHead"
android:padding="10dp"
android:text="Would you like to recommend this product?"
android:textColor="#color/gray"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/recommendText"
android:layout_marginBottom="5dp"
android:background="#drawable/lay_border"
android:weightSum="2">
<Button
android:id="#+id/yes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:background="#deffffff"
android:text="Yes"
android:textColor="#color/colorPrimary"
android:textSize="18sp" />
<Button
android:id="#+id/no"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:background="#f7f5f5"
android:text="No"
android:textColor="#color/colorPrimary"
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="#+id/productSellers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/recommend"
android:layout_marginTop="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/addSellersHere"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</RelativeLayout>

Categories

Resources