android - Adding Scrolling to Fragments Screen in a TabLayout -
i have collapsingtoolbarlayout , inside have tablayout. , display in same activity viewpager fragments of tablayout. can not make scroll work when slide on fragment. scrolling on tablayout , collapsingtoolbar, working.
when sliding through fragment screen not roll. , when sliding tablayout scrolling works normally. how solve this?
code:
<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" > <!--<include layout="@layout/content_perfil_empresa" />--> <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/colorprimary" app:expandedtitlegravity="bottom" app:expandedtitlemarginbottom="180dp" app:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="20dp" app:layout_scrollflags="scroll|exituntilcollapsed"> <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" tools:ignore="contentdescription" /> <!--<view android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:alpha="0.8"/>--> <textview android:id="@+id/tvnomecidade" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_marginbottom="155dp" android:layout_marginend="16dp" android:layout_marginstart="20dp" android:text="são paulo - sp" android:textcolor="@android:color/darker_gray" android:textsize="14sp" app:layout_collapsemode="parallax" /> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_marginbottom="155dp" android:layout_marginend="20dp" android:layout_marginstart="20dp" android:gravity="center_horizontal" android:orientation="vertical" app:layout_collapsemode="parallax"> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustviewbounds="true" android:background="@drawable/ic_info24" 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:text="sobre" android:textsize="12sp" />--> </linearlayout> <view android:layout_width="match_parent" android:layout_height="1dp" android:layout_gravity="bottom" android:layout_marginbottom="135dp" android:background="@color/cinzamedio" app:layout_collapsemode="parallax" /> <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:popuptheme="@style/themeoverlay.appcompat.light" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_marginbottom="75dp" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:background="@color/colorprimary" android:orientation="horizontal" app:layout_collapsemode="parallax"> <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"> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustviewbounds="true" android:background="@drawable/ic_chat_bubble_outline24" 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="mensagem" android:textsize="12sp" /> </linearlayout> <linearlayout android:layout_width="50dp" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustviewbounds="true" android:background="@drawable/ic_date_range24" 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="agenda" android:textsize="12sp" /> </linearlayout> <linearlayout android:layout_width="50dp" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical"> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustviewbounds="true" android:background="@drawable/ic_collections24" 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"> <imagebutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:adjustviewbounds="true" android:background="@drawable/ic_favorite_border" 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="2.650" android:textsize="12sp" /> </linearlayout> </linearlayout> </linearlayout> <view android:layout_width="match_parent" android:layout_height="1dp" android:layout_gravity="bottom|end" android:layout_marginbottom="60dp" android:background="@color/cinzamedio" app:layout_collapsemode="parallax" /> <android.support.design.widget.tablayout android:id="@+id/tabs_perf_emp" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_gravity="bottom" android:background="@color/colorprimary" app:layout_collapsemode="pin"> </android.support.design.widget.tablayout> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <framelayout android:layout_width="match_parent" android:layout_height="match_parent" app:layout_anchor="@id/app_bar" app:layout_anchorgravity="bottom" app:layout_scrollflags="scroll|exituntilcollapsed" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <android.support.v4.view.viewpager android:id="@+id/pager_tabs_perf_emp" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> </framelayout> </android.support.design.widget.coordinatorlayout>
screen :
Comments
Post a Comment