Scrollview not working with viewpager android -
<?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:background="@android:color/white" tools:context="com.app.trainingapp.home.activity.productinfodetail"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/apptheme.appbaroverlay" android:visibility="visible"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="@dimen/toolbar_height" android:background="@color/colorprimary" android:visibility="visible" app:contentinsetend="0dp" app:contentinsetleft="0dp" app:contentinsetright="0dp" app:contentinsetstart="0dp" app:layout_collapsemode="parallax" app:layout_scrollflags="scroll|enteralways" app:popuptheme="@style/apptheme.popupoverlay"> <include layout="@layout/toolbar_product_detail" /> </android.support.v7.widget.toolbar> </android.support.design.widget.appbarlayout> <android.support.v4.widget.nestedscrollview android:id="@+id/detail_view_pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/appbar" android:fillviewport="true" android:focusableintouchmode="true" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:id="@+id/top_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:weightsum="1"> <linearlayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="0.4"> <imageview android:layout_width="wrap_content" android:layout_height="@dimen/product_detail_top_height" android:padding="@dimen/product_image_padding" android:src="@drawable/product" /> </linearlayout> <linearlayout android:layout_width="0dp" android:layout_height="@dimen/product_detail_top_height" android:layout_weight="0.6" android:gravity="center_vertical|center_horizontal"> <com.app.trainingapp.customviews.typefacedtextview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginright="10dp" android:ellipsize="end" android:text="@string/dummy_text" android:textcolor="@color/faint_black" app:customtypeface="ralewayregular" /> </linearlayout> </linearlayout> <view android:id="@+id/separator" android:layout_width="match_parent" android:layout_height="0.5dp" android:layout_below="@id/top_container" android:layout_marginleft="@dimen/view_margin_left" android:layout_marginright="@dimen/view_margin_left" android:background="@color/view_color_grey" /> <com.app.trainingapp.customviews.typefacedtextview android:id="@+id/txt_medication" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/separator" android:layout_margintop="@dimen/top_10" android:paddingleft="@dimen/left_10" android:text="@string/str_medication" android:textallcaps="true" android:textcolor="@android:color/black" android:textsize="@dimen/font_medication" app:customtypeface="ralewaybold" /> <com.app.trainingapp.utils.flowlayout android:id="@+id/flow_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/txt_medication" android:layout_margintop="@dimen/top_10" android:paddingleft="20dp" android:visibility="visible" app:horizontalspacing="@dimen/flow_item_horizaontal_spacing" app:orientation="horizontal" app:verticalspacing="@dimen/flow_item_vertical_spacing" /> <com.app.trainingapp.customviews.customviewpager android:id="@+id/medication_pager" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/flow_container" android:layout_margintop="@dimen/top_10"> <android.support.design.widget.tablayout android:id="@+id/medication_tabs" android:layout_width="match_parent" android:layout_height="@dimen/tab_layout_height" android:layout_gravity="top" android:background="@drawable/tablayout_line" app:tabindicatorcolor="@color/tab_selector_color" app:tabmode="scrollable" /> <!--<view--> <!--android:layout_width="match_parent"--> <!--android:layout_height="0.5dp"--> <!--android:layout_below="@id/medication_tabs"--> <!--android:background="@color/view_color_grey" />--> </com.app.trainingapp.customviews.customviewpager> </relativelayout> </linearlayout> </android.support.v4.widget.nestedscrollview>
check above xml, have viewpager insite nestedscrollview, want scroll whole page viewpager? problem when try scroll page it's not working , viewpager scrolls internally. please let me know if wrong in code.
Comments
Post a Comment