CoordinatorLayout using the ViewPager's RecyclerView - android

I am using the view CoordinatorLayout from android.support.design. I want to attach the app:layout_behavior to the fragment's RecyclerView?
In the example given by Google, they only attach it in the RecyclerView of the same XML file where the CoordinatorLayout was attached.
Is there a way to attach CoordinatorLayout to the fragment's RecyclerView within the ViewPager?
The sample is in this blog post at Android Developers blog.

Chris Banes has posted a sample on Github which shows exactly what you want to do.
Here is the xml file that defines how one can indirectly attach a coordinator layout to the viewpager's fragments.
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</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" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#drawable/ic_done" />
</android.support.design.widget.CoordinatorLayout>
The idea is to let the viewpager have the layout_behavior attribute.

This might be dumb, but it didn't worked due to the fact that the build tool was not updated in the build.gradle of the application version to 22, I was using 21 that is why it is not working as expected to be.
Edit:
Also what SanderTuit said: adding com.android.support:recyclerview-v7:22.2.0 will also solve the problem

Use a FrameLayout and inject your fragment into that FrameLayout. Then set
app:layout_behavior to it. The only thing you need to do is set layout_behavior
to a sibling of AppBayLayout and that sibling will below the toolbar.
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<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">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="#+id/frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>

I recently had the same problem mentioned in the post, and the above solutions did not work for me. Luckily I managed to solve it. So just to share I am posting here
The problem was that in my code I had set
recyclerView.setNestedScrollingEnabled(false);
due to which the appbar was not responding to recyclerView's scrolls despite setting the layout_behaviour attribute to the viewPager. Changing the above-mentioned attribute to
recyclerView.setNestedScrollingEnabled(true);
solved the problem and the appbar started responding to the recylerView's scroll.

After a few tests, I found that put the TabLayout outside AppBarLayout, will works, whatever the viewpager's Fragment contains. This is my main xml.
<com.tqmall.legend.konwledge.view.VerticalSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/swipe_refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.CoordinatorLayout
android:id="#+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFE6ECF0">
<android.support.design.widget.AppBarLayout
android:id="#+id/kn_main_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:contentScrim="#android:color/black"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<include
layout="#layout/banner_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.9" />
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="#33000000"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</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/main_fragment_issue_list_tab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:tabGravity="center"
app:tabIndicatorColor="#FF2CA2D5"
app:tabPaddingEnd="30sp"
app:tabPaddingStart="30sp"
app:tabSelectedTextColor="#FF2CA2D5"
app:tabTextColor="#FF4F5354" />
<android.support.v4.view.ViewPager
android:id="#+id/main_fragment_issue_list_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

I'm having the same problem, i solved the scrolling but putting toolbar and the tabs inside the app bar and wrap it and the viewpager with a coordinatorlayout.
Also in the layout of my recycle view(to be inflated) i add the layout_behavior. It works but the problem is everything is over each other.
This is my main page
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="#+id/music_foot"
>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/view_pager"
/>
<view
android:layout_width="match_parent"
android:layout_height="wrap_content"
class="android.support.design.widget.AppBarLayout"
android:id="#+id/appBar"
>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="#1e88e5"
android:id="#+id/toolbar"
app:layout_scrollFlags="scroll|enterAlways"
></android.support.v7.widget.Toolbar>
<view
android:layout_width="match_parent"
android:layout_height="56dp"
class="com.astuetz.PagerSlidingTabStrip"
android:id="#+id/pager_tabs"
android:layout_below="#+id/appBar"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</view>
and this is my layout for the adapter
<android.support.v7.widget.RecyclerView
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"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:id="#+id/recycleView" />
If I get it to work better ill tell you.

Related

Hide ActionBar on ListView scroll contained in a Fragment within a ViewPager

I want to hide the ActionBar on ListView scroll.
The official documentation suggests we use this pattern to do so:
<android.support.design.widget.CoordinatorLayout
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">
<! -- Your Scrollable View -->
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
...
app:layout_scrollFlags="scroll|enterAlways">
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
I can't, however, use this pattern since my "Scrollable view" is a ListView inside a Fragment that is rendered inside the ViewPager. I use the following code in my app:
<?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/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.x.y.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="#dimen/appbar_padding_top"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
style="#style/AppTabLayout"
android:id="#+id/tabs"
app:tabTextAppearance="#style/AppTabTextAppearance"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="#dimen/fab_margin"
android:src="#mipmap/ic_add_white_24dp" />
</android.support.design.widget.CoordinatorLayout>
I've tried putting the ViewPager inside the AppBarLayout, and the Toolbar and TabLayout in a CollapsibleToolbarLayout. However, if I do that, the ViewPager layout isn't even shown and the ActionBar is permanently hidden.
What do I do?
CoordinatorLayout doesn't work with listview. So either replace the listview with a recyclerview (which i would highly recommend) or put your listview inside a NestedScrollView. The xml code you posted is ok. If any of these is not working then post your fragment's xml code and hit me up again

Appbarlayout overlaps with NestedScrollView

I have a coordinator layout, which consists of appbarlayout and nestedscrollview. The problem is that when I open the activity, some part of nestedscrollview is by default hidden behind the expanded action bar (difference shown in the images).
XML File :
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/my_appbar_container"
android:layout_width="match_parent"
android:layout_height="250dp"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:contentScrim="#color/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/ivToolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:alpha="0.6"
app:layout_collapseParallaxMultiplier="0.7" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_collapseMode="pin"
android:alpha="1.0"
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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
......
.......
I am not able to figure out what's the issue here, and couldn't find anywhere online. Maybe it's a bug. Please check.
I ran into the same problem, setting the layout height of the NestedScrollView to android:layout_height="wrap_content" fixed it for me.
Hope it helps
I solved this problem by having the NestedScrollView inside a FrameLayout like this
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v4.widget.NestedScrollView
android:background="#color/main_color_white"
android:layout_width="match_parent"
android:layout_height="wrap_content">
...............
.............
</android.support.v4.widget.NestedScrollView>
</FrameLayout>
Or you can try adding a padding to your NestedScrollView like this
<android.support.v4.widget.NestedScrollView
android:background="#color/main_color_white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="?attr/actionBarSize">
................
................
</android.support.v4.widget.NestedScrollView>
Don't know why but this answer worked on my issue.
Btw I faced with this problem only when I change visibility of any view inside nestedScrollView

Viewpager not scrolling in Coordinator layout

This is my layout
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="280dp"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="250dp"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="100dp"
android:gravity="top"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:titleMarginTop="15dp">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="#+id/category_tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="#f0f0f0"
android:focusable="false" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#color/talview_color_1" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
I am trying to pin the tablayout on top while scrolling. It doesn't work. More important point is, there is a listview in each viewpager fragment and the listview scrolling doesn't work in the listview.
Can anybody help
You need to use NestedScrollView, provided in Android Support Library v4, which is designed to work with CoordinatorLayout
<android.support.v4.widget.NestedScrollView ...>
<LinearLayout ...>
...
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
or RecyclerView, please note that the classic ListView doesn't work with CoordinatorLayout.
so inside your viewPager you need to have NestedScrollView or RecyclerView
Good luck

CoordinatorLayout with Tabs in android?

I am new for CoordinatorLayout i want to use coordinatorLayout in my application but it cause some problem in display CollapsingToolbarLayout view.
i want to design view like whatsApp screen Tabs in Coordinatorlayout
My XML Code
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/detail_backdrop_height"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fitsSystemWindows="false"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="32dp"
app:expandedTitleMarginStart="24dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<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/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
</LinearLayout>
<android.support.design.widget.TabLayout
android:id="#+id/tabanim_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/tabanim_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
// child view
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>`
I Found Solution for Tabs in CoordinatorLayout
<?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"
android:id="#+id/tabanim_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/tabanim_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="#+id/tabanim_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
/***
Here You can add custom layout
**/
<android.support.design.widget.TabLayout
android:id="#+id/tabanim_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/tabanim_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
CoordinatorLayout is delicate sometimes, I suggest you to follow the next example using it as a base and adding more complexity step by step if you need:
https://gist.github.com/RicardAparicio/f41523daaa0edbe0b4399549fff4da3f
Hope it helps.
"but it cause some problem in display" doesn't say what kind of problem You had, glad You found the solution though.
There is indeed problem in both 22.2.1 and 23.0.1 support libraries with TabLayout and ViewPager in CoordinatorLayout while using fitsSystemWindows="true". While using RecyclerView and scrolling it up TabLayout header goes into status bar while it's background color is not being pinned.
I might only imply that above was one of Your problems, if yes then removing fitsSystemWindows is not best solution as application will loose a lot of it's look in 5.0+ Android.
It is not good solution either but I managed to fix this issue by adding nested android.support.design.widget.CoordinatorLayout, but if You use DrawerLayout there, then nothing is needed as shown in this example: https://github.com/chrisbanes/cheesesquare

Fixed TabLayout and Content overlap AppBar

With the new Android Support Design library, there has come some cool features with regards to the AppBar.
I'm looking at implementing the same scroll effect as shown in the gif above. (Taken from Google Play Games -> My Games)
I've had a look at adding the following attribute to the nestedscrollview, placing the content above the appbar.
app:behavior_overlapTop
It works as expected when all the components inside appbar is set to scroll.
app:layout_scrollFlags="scroll"
If I want the TabLayout to be pinned at the top, the space below it will also be pinned. So it looks weird:
In short, is there any way to create the above using the new design library, or do I have to make it some other way?
Requested XML:
<android.support.design.widget.CoordinatorLayout
android:id="#+id/content"
android:layout_height="match_parent"
android:layout_width="match_parent">
<android.support.design.widget.AppBar
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="164dp"
android:background="?attr/colorPrimary">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll"/>
<android.support.design.widget.TabLayout
android:id="#+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBar>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:clipToPadding="false"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:behavior_overlapTop="32dp"/>
</android.support.design.widget.CoordinatorLayout>
Try this, Hope its work
Set app:layout_scrollFlags="scroll|enterAlways" in Toolbar
and android:scrollbars="horizontal" in TabLayout
As per my suggestion, you should remove this line app:layout_scrollFlags="scroll|enterAlways" in your TabLayout
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app1="http://schemas.android.com/apk/res/com.samsung.ssc"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/white"
tools:context="com.samsung.ssc.LMS.LMSListActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimary"
android:elevation="4dp"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways">
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="#+id/tabLayoutLMSList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:scrollbars="horizontal">
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpagerLMSList"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="#+id/fabCreateNewLMS"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_gravity="right|bottom"
android:layout_margin="#dimen/margin_15"
android:onClick="onNewLeaveCreateClick"
android:src="#drawable/ems_pencil"
app1:rippleColor="#color/ems_status_sky_blue_color"
app:backgroundTint="#color/ems_status_yellow_color"
app:borderWidth="#dimen/margin_0"
app:elevation="#dimen/margin_5" />

Categories

Resources