I am trying to implement pull to refresh on CoordinatorLayout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/linearMain"
android:layout_width="match_parent"
android:layout_height="990dp"
android:orientation="vertical">
<android.support.v4.widget.DrawerLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/contentView"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<FrameLayout
android:id="#+id/frameAdvertiseSlider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|snap">
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerAdvertiseSlider"
android:layout_width="match_parent"
android:layout_height="#dimen/pager_advertise_slider_height"
android:layout_gravity="top" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/indicatorAdvertiseSlider"
style="#style/IntroPageIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="#dimen/margin_medium" />
</FrameLayout>
<LinearLayout
android:id="#+id/linearLayoutMainCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_mini_small"
android:orientation="horizontal"
app:layout_scrollFlags="scroll|snap">
<Button
android:id="#+id/buttonMainCategory1"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="#drawable/ic_category"
android:paddingBottom="12dp"
android:paddingTop="15dp"
android:text="#string/home_category_category" />
<Button
android:id="#+id/buttonMainCategory2"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_action"
android:paddingTop="15dp"
android:text="#string/home_category_action" />
<Button
android:id="#+id/buttonMainCategory3"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_new"
android:paddingTop="15dp"
android:text="#string/home_category_new" />
<Button
android:id="#+id/buttonMainCategory4"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_most_selling"
android:paddingTop="5dp"
android:text="#string/home_category_most_selling" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayoutBanners"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_mini_small"
android:layout_marginTop="#dimen/margin_mini_small"
android:orientation="horizontal"
app:layout_scrollFlags="scroll|snap">
<ImageView
android:id="#+id/imageBanner1"
android:layout_width="0dp"
android:layout_height="#dimen/banner1_height"
android:layout_weight="1"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="#dimen/banner1_height"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="#+id/imageBanner2"
android:layout_width="match_parent"
android:layout_height="#dimen/banner2_height"
android:scaleType="fitXY" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#00000000" />
<ImageView
android:id="#+id/imageBanner3"
android:layout_width="match_parent"
android:layout_height="#dimen/banner2_height"
android:scaleType="fitXY" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|snap"
android:layout_marginBottom="#dimen/margin_mini_small">
<android.support.design.widget.TabLayout
android:id="#+id/tabLayoutNews"
android:layout_width="match_parent"
android:layout_height="#dimen/tabs_height"
android:background="#color/white"
app:tabIndicatorColor="#color/main_color"
app:tabMode="fixed"
app:tabSelectedTextColor="#color/home_tab_color"
app:tabTextColor="#color/home_tab_color" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerNews"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.design.widget.TabLayout
android:id="#+id/tabLayoutPager"
android:layout_width="match_parent"
android:layout_height="#dimen/tabs_height"
android:background="#color/white"
app:tabGravity="center"
app:tabIndicatorColor="#color/main_color"
app:tabMode="scrollable"
app:tabSelectedTextColor="#color/home_tab_color"
app:tabTextColor="#color/home_tab_color" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerTabs"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/home_profile_background" />
<LinearLayout
android:id="#+id/linearProfile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/margin_medium"
android:orientation="vertical">
<rs.netlink.android.widgets.CircleImageView
android:id="#+id/circleImageViewProfile"
android:layout_width="#dimen/profile_image_size"
android:layout_height="#dimen/profile_image_size"
android:scaleType="centerCrop"
android:src="#drawable/default_profile_image"
app:border_color="#color/home_profile_image_ellipse"
app:border_width="1dp" />
<TextView
android:id="#+id/textName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_small_medium"
android:textColor="#color/home_profile_image_ellipse"
android:textSize="#dimen/text_small_normal" />
<TextView
android:id="#+id/textEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_mini_small"
android:textColor="#color/home_profile_image_ellipse"
android:textSize="#dimen/text_micro_mini" />
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/margin_small">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuHome"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_home"
android:drawableStart="#drawable/ic_menu_home"
android:text="#string/menu_home"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuProfile"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_profile"
android:drawableStart="#drawable/ic_menu_profile"
android:text="#string/menu_profile"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuBasket"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_basket"
android:drawableStart="#drawable/ic_menu_basket"
android:text="#string/menu_basket"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuWishList"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_wish_list"
android:drawableStart="#drawable/ic_menu_wish_list"
android:text="#string/menu_wish_list"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuWhereToBay"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_where_to_bay"
android:drawableStart="#drawable/ic_where_to_bay"
android:text="#string/menu_where_to_buy"
app:font="#string/font_bold"/>
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/home_menu_separator_line" />
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuSettings"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_settings"
android:drawableStart="#drawable/ic_menu_settings"
android:text="#string/menu_settings"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuCallCenter"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_call_center"
android:drawableStart="#drawable/ic_call_center"
android:text="#string/menu_call_centar"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuAboutUs"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_about_us"
android:drawableStart="#drawable/ic_about_us"
android:text="#string/menu_about_us"
app:font="#string/font_bold"/>
<rs.netlink.android.widgets.MyButton
android:id="#+id/buttonMenuTerms"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_terms"
android:drawableStart="#drawable/ic_terms"
android:text="#string/menu_terms"
app:font="#string/font_bold"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
</LinearLayout>
and it trigger refresh but then when I try to refresh viewpager
categories = categoryList;
TabsPagerAdapter tabsPager = new
TabsPagerAdapter(getSupportFragmentManager(), categories);
viewPagerCategories.setAdapter(tabsPager);
tableLayout.setupWithViewPager(viewPagerCategories);
viewPagerCategories.addOnPageChangeListener(this);
scroll in AppBarLayout don't work. I can't scroll to bottom anymore.
Can someone help me. Thanks.
You can try the repo nestrefresh. Replace AppBarLayout with RefreshBarLayout in lib. And add scroll behavior for the viewpager.
Related
I create Layout which consists
CoordinatorLayout
AppBarLayout
CollapsingToolbarLayout
Image
Toolbar
and include one layout for content.
Why the content layout when scroll up is over the toolbar?
This is pic first open Activity
This is pic first open Activity
when scroll down
and scroll up
main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.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"
tools:context=".Activity_Movie">
<com.google.android.material.appbar.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/detail_backdrop_height"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/backdrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:srcCompat="#drawable/a_poster_joker" />
<androidx.appcompat.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<include layout="#layout/content_activity__movie" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
content_activity__movie.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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/Movie_Nested"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="false"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context=".Activity_Movie"
tools:showIn="#layout/p__movie">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="false"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:orientation="vertical">
<TextView
android:id="#+id/Movie_Title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Title"
android:textColor="#color/colorPrimary"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dip"
android:orientation="horizontal">
<LinearLayout
android:layout_width="160dip"
android:layout_height="200dip"
android:orientation="horizontal"
android:padding="5dip">
<ImageView
android:id="#+id/Movie_Img"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:srcCompat="#tools:sample/avatars[3]" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="200dip"
android:orientation="vertical"
android:padding="10dip">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Score"
android:textColor="#color/colorBlack"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical">
<com.mancj.slimchart.SlimChart
android:id="#+id/slimChart"
android:layout_width="80dip"
android:layout_height="80dip"
app:roundedEdges="true"
app:strokeWidth="8dp"
app:text="0"
app:textColor="#color/colorAccent" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Genre"
android:textColor="#color/colorBlack"
android:textStyle="bold" />
<TextView
android:id="#+id/Movie_Genre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="ACTION"
android:textColor="#color/colorBlack" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Release Date"
android:textColor="#color/colorBlack"
android:textStyle="bold" />
<TextView
android:id="#+id/Movie_Release"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="2019-11-02"
android:textColor="#color/colorBlack" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dip"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sinopsis"
android:textColor="#color/colorBlack"
android:textStyle="bold" />
<TextView
android:id="#+id/Movie_Sinopsis"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=". . . . . "
android:textColor="#color/colorBlack" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dip"
android:layout_marginBottom="10dip"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#color/colorPrimary"
android:orientation="horizontal"
android:padding="5dip">
<TextView
android:id="#+id/Movie_Label_Other"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Movie Action Lainnya"
android:textColor="#color/colorWhite"
android:textStyle="bold" />
</LinearLayout>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:animationCache="true"
android:elevation="4dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="5dip"
android:orientation="horizontal">
<GridView
android:id="#+id/Movie_Grid"
android:layout_width="1050dip"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"
android:layout_marginTop="10dip"
android:layout_marginRight="10dip"
android:layout_marginBottom="10dip"
android:columnWidth="100dip"
android:elevation="5dip"
android:gravity="center"
android:horizontalSpacing="5dip"
android:numColumns="10"
android:scrollbars="horizontal"
android:stretchMode="none"
android:verticalSpacing="5dip" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
use this tag into toolbar :
app:layout_scrollFlags="scroll|enterAlways|snap"
hope it will help you.
I am trying to use CoordinatorLayout and CollapsingToolbar and SoftInputMode.When I tried to use android:fitsSystemWindows="false" in Coordinator Layout. It works well. But, SoftInputMode not working. That means when EditText is active the layout must resize. I added SOftInputMode to Manifest file.But ,It is not working.
The problem is when android:fitsSystemWindows="false", status bar background not working. But, Layout resizing working well.
Similarly, when android:fitsSystemWindows="true", status bar background works well. But, Layout resizing not working.
My code for Layout is
<?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"
app:statusBarBackground="#color/myCustomColor"
android:theme="#style/AppThemeCorrdinate"
android:fitsSystemWindows="false"
tools:context="com.uiresource.messenger.Conversation">
<android.support.design.widget.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/my_gradient_bg"
android:fitsSystemWindows="true"
android:theme="#style/AppTheme.AppBarOverlay"
app:expanded="false">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsetoolbar"
android:layout_width="match_parent"
android:layout_height="330dp"
android:fitsSystemWindows="true"
app:contentScrim="#drawable/my_gradient_bg"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
app:titleEnabled="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v4.app.FragmentTabHost
android:id="#android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingBottom="#dimen/activity_vertical_margin">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="#android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
<FrameLayout
android:id="#+id/realTabContent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0" />
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</android.support.v4.view.ViewPager>
</LinearLayout>
<TabWidget
android:id="#android:id/tabs"
style="#style/MyTabStyle"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="bottom"
android:layout_weight="0"
android:orientation="horizontal"
android:showDividers="none"
android:visibility="gone" />
</android.support.v4.app.FragmentTabHost>
</LinearLayout>
<HorizontalScrollView
android:id="#+id/chipscrollview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:fitsSystemWindows="true"
android:scrollbars="none">
<RadioGroup
android:id="#+id/radiogroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_gravity="bottom"
android:orientation="horizontal"
android:scrollbars="none">
</RadioGroup>
</HorizontalScrollView>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0"
android:background="#android:color/black"
android:fitsSystemWindows="true"
app:layout_collapseParallaxMultiplier="1.0" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top"
android:layout_marginBottom="0dp"
app:layout_collapseMode="pin"
app:popupTheme="#style/AppTheme.PopupOverlay">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter"
android:src="#drawable/user1" />
<TextView
android:id="#+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:gravity="center"
android:textAllCaps="false"
android:textAppearance="#style/Light"
android:textColor="#android:color/white"
android:textSize="#dimen/h1" />
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="#+id/htab_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:visibility="gone"
app:tabIndicatorColor="#android:color/white"
app:tabSelectedTextColor="#android:color/white"
app:tabTextColor="#color/white" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.design.widget.FloatingActionButton
android:id="#+id/add_to_cart_fab2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="#android:drawable/ic_menu_save"
android:visibility="gone"
app:layout_anchor="#id/toolbar"
app:layout_anchorGravity="bottom|right" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/add_to_cart_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="#android:drawable/ic_menu_save"
android:visibility="gone"
app:layout_anchor="#id/htab_appbar"
app:layout_anchorGravity="bottom|center" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/root_layout"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:fillViewport="true"
>
<RelativeLayout
android:id="#+id/rootView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#id/rl_bottom">
<LinearLayout
android:id="#+id/layout_rvh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/chaty_bg"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:clipToPadding="false"
android:overScrollMode="never"
android:paddingTop="8dp"
android:paddingBottom="20dp" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:fitsSystemWindows="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<HorizontalScrollView
android:id="#+id/hsv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="#color/white"
android:gravity="bottom"
android:scrollbars="none"
android:visibility="visible">
<LinearLayout
android:id="#+id/chat_quick_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<include
layout="#layout/rich_replies_card"
android:visibility="visible" />
</LinearLayout>
</HorizontalScrollView>
<RelativeLayout
android:id="#+id/editContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/hsv_content"
android:background="#E9EDED"
android:paddingLeft="#dimen/space10"
android:paddingTop="#dimen/space5"
android:paddingRight="#dimen/space5"
android:paddingBottom="#dimen/space5">
<ImageButton
android:id="#+id/bt_send"
android:layout_width="50dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:background="#drawable/bg_btnsend_rounded"
android:gravity="center"
android:padding="#dimen/space5"
android:src="#drawable/baseline_send_white_36"
android:stateListAnimator="#null"
android:textAppearance="#style/Light"
android:textColor="#color/white"
android:textSize="#dimen/h3" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="#dimen/space5"
android:layout_toLeftOf="#id/bt_send"
android:background="#drawable/bg_white_rounded">
<ImageButton
android:id="#+id/bt_attachment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="#android:color/transparent"
android:padding="#dimen/space10"
app:srcCompat="#drawable/ic_attachment" />
<EditText
android:id="#+id/et_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="#id/bt_attachment"
android:background="#android:color/transparent"
android:hint="Enter your message"
android:inputType="textCapSentences"
android:maxLines="3"
android:padding="#dimen/space10"
android:textAppearance="#style/ThemeOverlay.AppCompat.Dark"
android:textColor="#color/colorTextBlack"
android:textColorHint="#color/colorTextHint"
android:textSize="#dimen/h2" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="gone"
android:gravity="bottom">
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
1.remove android:fitsSystemWindows="false",Because it can lead to layout scroll.on the Android 4.x
2.By setting style them to change the statusbar color.
I am tying to add image in a Fragment with image at the top and parallax effect when scrolled down. I tried doing this using Collapsible Toolbar, but image is not filling up the Collapsible Toolbar, and parallax is not working.
I want something like this
But this is what I achieved till now.
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:card_view="http://schemas.android.com/tools"
android:id="#+id/drawerlayout1">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinatorlayout"
android:layout_width="fill_parent"
android:layout_height="match_parent"
app:expandedTitleMarginStart="70dp">
<android.support.design.widget.AppBarLayout
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:layout_width="fill_parent"
android:id="#+id/actionbarlayout"
android:layout_height="207dp">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/CollapsingToolbarLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:contentScrim="#color/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:id="#+id/details_Image"
app:layout_collapseMode="parallax"
/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar1"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
android:minHeight="?attr/actionBarSize"/>
</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"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardElevation="3dp"
card_view:cardCornerRadius="7dp"
android:layout_margin="5dp"
android:id="#+id/new_order"
card_view:cardBackgroundColor="#color/cardview_shadow_end_color"
>
<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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:layout_marginTop="15dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/download"
android:background="#null"
android:src="#drawable/ic_action_ic_file_download_white_36dp"
android:layout_centerInParent="true"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/favourite"
android:layout_centerInParent="true"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/zoom"
android:background="#null"
android:src="#drawable/ic_action_ic_zoom_out_map_white_36dp"
android:layout_centerInParent="true"
/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/imageDescription"
android:text="keckwcbjbewbcbcbcwjbejwkbcwkbcbwjc"
/>
</ScrollView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"
android:id="#+id/fullimage"/>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinatorlayout"
android:layout_width="fill_parent"
android:layout_height="match_parent"
app:expandedTitleMarginStart="70dp">
<android.support.design.widget.AppBarLayout
android:id="#+id/actionbarlayout"
android:layout_width="fill_parent"
android:layout_height="207dp"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/CollapsingToolbarLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="#color/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/details_Image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="#color/colorAccent"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar1"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar" />
</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"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="#+id/new_order"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardBackgroundColor="#color/cardview_shadow_end_color"
card_view:cardCornerRadius="7dp"
card_view:cardElevation="3dp">
<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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:gravity="center"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageButton
android:id="#+id/download"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="#drawable/ic_action_ic_file_download_white_36dp"
android:background="#null" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageView
android:id="#+id/favourite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<ImageButton
android:id="#+id/zoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="#drawable/ic_action_ic_zoom_out_map_white_36dp"
android:background="#null" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp">
<TextView
android:id="#+id/imageDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="keckwcbjbewbcbcbcwjbejwkbcwkbcbwjc"
/>
</ScrollView>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<ImageView
android:id="#+id/fullimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone" />
</android.support.design.widget.CoordinatorLayout>
Replace your code with this.
i have a coordinator layout with collapsable toolbar and below it i have a tablayout and a viewpager and the viewpager contains an expandable listview. When the toolbar collapses the viewpager goes inside the tablayout even if i have specified margins. I have attached links to images below.
Any help is appreciated. Pls help.
http://imgur.com/aK1gyAj.jpg
http://imgur.com/aoa6aUL.jpg
<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/coordinatorlayout_asset"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
tools:ignore="RtlHardcoded">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar_asset"
android:layout_width="match_parent"
android:layout_height="330dp"
android:layout_marginBottom="56dp"
android:background="#android:color/transparent"
android:fitsSystemWindows="true"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingtoolbar_asset"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/transparent"
android:fitsSystemWindows="true"
app:contentScrim="#color/white"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax">
<android.support.design.widget.TabLayout
android:id="#+id/tab_layout_charts_asset"
android:layout_width="match_parent"
android:layout_height="0dp" />
<android.support.v4.view.ViewPager
android:id="#+id/pager_charts_asset"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="#+id/imageView_dots_asset"
android:paddingTop="0dp" />
<ImageView
android:id="#+id/imageView_dots_asset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="96dp"
android:src="#drawable/united1"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<FrameLayout
android:id="#+id/frame_layout_asset"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="bottom|center_horizontal"
android:background="#color/colorPrimary"
android:orientation="vertical"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier=".11">
<LinearLayout
android:id="#+id/linear_layout_asset"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:gravity="center"
android:text="Quila"
android:textColor="#android:color/white"
android:textSize="20sp" />
</LinearLayout>
</FrameLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nestedscrollview_asset"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:layout_marginTop="56dp"
app:layout_anchor="#id/appbar_asset"
app:layout_anchorGravity="bottom"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v4.view.ViewPager
android:id="#+id/pager_asset"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.v4.widget.NestedScrollView>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_asset"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#color/tab_color"
app:layout_anchor="#id/frame_layout_asset"
app:theme="#style/ThemeOverlay.AppCompat.Dark"
app:title="">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Space
android:layout_width="#dimen/image_final_width"
android:layout_height="#dimen/image_final_width" />
<TextView
android:id="#+id/tv_toolbar_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:gravity="center_vertical"
android:text="Bank Name"
android:textColor="#android:color/white"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="#+id/tab_layout_asset"
android:layout_width="match_parent"
android:layout_height="32dp"
android:background="#color/tab_color"
android:elevation="6dp"
android:minHeight="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_anchor="#id/toolbar_asset"
app:layout_anchorGravity="bottom"
app:tabIndicatorColor="#color/white" />
<de.hdodenhof.circleimageview.CircleImageView
android:layout_width="#dimen/image_width"
android:layout_height="#dimen/image_width"
android:layout_gravity="center_horizontal"
android:src="#drawable/newUser"
app:finalHeight="#dimen/image_final_width"
app:finalYPosition="2dp"
app:layout_behavior="com.aswin.AvatarImageBehavior"
app:startHeight="2dp"
app:startToolbarPosition="2dp"
app:startXPosition="2dp" />
<FrameLayout 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:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ExpandableListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/expandable_listview"
android:divider="#color/black"
android:layout_gravity="top">
</ExpandableListView>
</LinearLayout>
I am trying to create something like this
<android.support.design.widget.CoordinatorLayout
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
<FrameLayout
android:id="#+id/frameAdvertiseSlider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|snap">
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerAdvertiseSlider"
android:layout_width="match_parent"
android:layout_height="#dimen/pager_advertise_slider_height"
android:layout_gravity="top" />
<com.viewpagerindicator.CirclePageIndicator
android:id="#+id/indicatorAdvertiseSlider"
style="#style/IntroPageIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginBottom="#dimen/margin_medium" />
</FrameLayout>
<LinearLayout
android:id="#+id/linearLayoutMainCategory"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_mini_small"
android:orientation="horizontal"
app:layout_scrollFlags="scroll|snap">
<Button
android:id="#+id/buttonMainCategory1"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="#drawable/ic_category"
android:paddingBottom="12dp"
android:paddingTop="15dp"
android:text="#string/home_category_category" />
<Button
android:id="#+id/buttonMainCategory2"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_action"
android:paddingTop="15dp"
android:text="#string/home_category_action" />
<Button
android:id="#+id/buttonMainCategory3"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_new"
android:paddingTop="15dp"
android:text="#string/home_category_new" />
<Button
android:id="#+id/buttonMainCategory4"
style="#style/ButtonHomeStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:drawablePadding="5dp"
android:drawableTop="#drawable/ic_most_selling"
android:paddingTop="5dp"
android:text="#string/home_category_most_selling" />
</LinearLayout>
<LinearLayout
android:id="#+id/linearLayoutBanners"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/margin_mini_small"
android:layout_marginTop="#dimen/margin_mini_small"
android:orientation="horizontal"
app:layout_scrollFlags="scroll|snap">
<ImageView
android:id="#+id/imageBanner1"
android:layout_width="0dp"
android:layout_height="#dimen/banner1_height"
android:layout_weight="1"
android:scaleType="fitXY" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="#dimen/banner1_height"
android:layout_marginLeft="1dp"
android:layout_marginStart="1dp"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="#+id/imageBanner2"
android:layout_width="match_parent"
android:layout_height="#dimen/banner2_height"
android:scaleType="fitXY" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#00000000" />
<ImageView
android:id="#+id/imageBanner3"
android:layout_width="match_parent"
android:layout_height="#dimen/banner2_height"
android:scaleType="fitXY" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|snap"
android:layout_marginBottom="#dimen/margin_mini_small">
<android.support.design.widget.TabLayout
android:id="#+id/tabLayoutNews"
android:layout_width="match_parent"
android:layout_height="#dimen/tabs_height"
android:background="#color/white"
app:tabIndicatorColor="#color/main_color"
app:tabMode="fixed"
app:tabSelectedTextColor="#color/home_tab_color"
app:tabTextColor="#color/home_tab_color" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerNews"
android:layout_width="match_parent"
android:layout_height="#dimen/news_pager_height"/>
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.design.widget.TabLayout
android:id="#+id/tabLayoutPager"
android:layout_width="match_parent"
android:layout_height="#dimen/tabs_height"
android:background="#color/white"
app:tabGravity="center"
app:tabIndicatorColor="#color/main_color"
app:tabMode="scrollable"
app:tabSelectedTextColor="#color/home_tab_color"
app:tabTextColor="#color/home_tab_color" />
<android.support.v4.view.ViewPager
android:id="#+id/viewPagerTabs"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="#+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
android:src="#drawable/home_profile_background" />
<LinearLayout
android:id="#+id/linearProfile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/margin_medium"
android:orientation="vertical">
<rs.netlink.android.widgets.CircleImageView
android:id="#+id/circleImageViewProfile"
android:layout_width="#dimen/profile_image_size"
android:layout_height="#dimen/profile_image_size"
android:scaleType="centerCrop"
android:src="#drawable/default_profile_image"
app:border_color="#color/home_profile_image_ellipse"
app:border_width="1dp" />
<TextView
android:id="#+id/textName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_small_medium"
android:textColor="#color/home_profile_image_ellipse"
android:textSize="#dimen/text_small_normal" />
<TextView
android:id="#+id/textEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/margin_mini_small"
android:textColor="#color/home_profile_image_ellipse"
android:textSize="#dimen/text_micro_mini" />
</LinearLayout>
</RelativeLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="#dimen/margin_small">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<Button
android:id="#+id/buttonMenuHome"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_home"
android:drawableStart="#drawable/ic_menu_home"
android:text="#string/menu_home" />
<Button
android:id="#+id/buttonMenuProfile"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_profile"
android:drawableStart="#drawable/ic_menu_profile"
android:text="#string/menu_profile" />
<Button
android:id="#+id/buttonMenuBasket"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_basket"
android:drawableStart="#drawable/ic_menu_basket"
android:text="#string/menu_basket" />
<Button
android:id="#+id/buttonMenuWishList"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_wish_list"
android:drawableStart="#drawable/ic_menu_wish_list"
android:text="#string/menu_wish_list" />
<Button
android:id="#+id/buttonMenuWhereToBay"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_where_to_bay"
android:drawableStart="#drawable/ic_where_to_bay"
android:text="#string/menu_where_to_buy" />
<View
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#color/home_menu_separator_line" />
<Button
android:id="#+id/buttonMenuSettings"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_menu_settings"
android:drawableStart="#drawable/ic_menu_settings"
android:text="#string/menu_settings" />
<Button
android:id="#+id/buttonMenuCallCenter"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_call_center"
android:drawableStart="#drawable/ic_call_center"
android:text="#string/menu_call_centar" />
<Button
android:id="#+id/buttonMenuAboutUs"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_about_us"
android:drawableStart="#drawable/ic_about_us"
android:text="#string/menu_about_us" />
<Button
android:id="#+id/buttonMenuTerms"
style="#style/ButtonHomeMenuBorderlessWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_terms"
android:drawableStart="#drawable/ic_terms"
android:text="#string/menu_terms" />
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.design.widget.NavigationView>
When I try this content in AppBarLayout is showed how much is screen height. When I set DrawerLayout android:layout_height="wrap_content" it does not work. How to resolve this.
Thanks.
You would want the closing tag </android.support.design.widget.AppBarLayout> after the include toolbar and not where you have it after a linear layout. The way you have it is including most of what you define here in your AppBarLayout instead of below it, which is not what I think you are try to do.