<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>