I have a toolbar and a recyclerview to show notification list when clicked on the badge on tool bar.but my recyclerview is overlapping the toolbar. I need the recycler to start below the toolbar so the user can close it by touching the badge again.how can I solve this problem, can anyone help out?
LAYOUT_FILE.xml
<android.support.v4.widget.DrawerLayout 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/dd_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NavigationDrawerActivity">
<LinearLayout
android:id="#+id/toollbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="#layout/navigation_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"></include>
<WebView
android:id="#+id/webViewID"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="#+id/left_drawer_parent"
android:layout_width="280dp"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="left|start">
<include
layout="#layout/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="#+id/left_drawer"
android:layout_width="280dp"
android:layout_height="match_parent"
android:paddingRight="10dp"
android:layout_gravity="left|start"
android:background="#color/gray"
android:choiceMode="singleChoice"
android:divider="#null"
android:scrollbars="vertical"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
</LinearLayout>
<RelativeLayout
android:id="#+id/rlNotificLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/black"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:padding="7dp"
android:visibility="gone" >
<android.support.v7.widget.RecyclerView
android:id="#+id/listView_Notific_Link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#c4c3bf"
android:scrollbars="vertical"
android:divider="#c4c3bf"
android:dividerHeight="7dp"
android:paddingRight="2dp"
android:paddingLeft="2dp"
android:paddingBottom="7dp"
/>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
You should use constraint layout: check out documentation here
Here's a nefty workaround on that. Set a top margin on your recyclerview. Use the layout_marginTop property and set it to ?actionBarSize. It should begin its layout below the toolbar.
You should use
app:layout_behavior="#string/appbar_scrolling_view_behavior"
inside your recyclerview
Try putting layout to the top. Topmost layout goes bottom.
<android.support.v4.widget.DrawerLayout 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/dd_drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".NavigationDrawerActivity">
<LinearLayout
android:id="#+id/toollbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="#+id/rlNotificLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginTop="50dp"
android:background="#color/black"
android:padding="7dp"
android:visibility="gone">
<android.support.v7.widget.RecyclerView
android:id="#+id/listView_Notific_Link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#c4c3bf"
android:divider="#c4c3bf"
android:dividerHeight="7dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingBottom="7dp"
android:scrollbars="vertical" />
</RelativeLayout>
<include
layout="#layout/navigation_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<WebView
android:id="#+id/webViewID"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:id="#+id/left_drawer_parent"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:orientation="vertical">
<include
layout="#layout/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="#+id/left_drawer"
android:layout_width="280dp"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:background="#color/gray"
android:choiceMode="singleChoice"
android:divider="#null"
android:paddingRight="10dp"
android:scrollbars="vertical"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>
You can use SlidingUpPanel layout.
https://github.com/umano/AndroidSlidingUpPanel
Related
i can' scroll my listView in DrawerLayout.
mycode activity_main:
<androidx.drawerlayout.widget.DrawerLayout 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:orientation="vertical"
android:id="#+id/drawerLayout"
tools:openDrawer="start"
android:fitsSystemWindows="true"
android:layout_height="match_parent"
tools:context=".activities.MapActivity">
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:id="#+id/navigationViewRight"
android:layout_marginTop="30dp"
android:layout_marginBottom="5dp"
android:layout_height="match_parent"
android:layout_gravity="end">
<include
layout="#layout/layout_evennements"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.navigation.NavigationView>
<com.google.android.material.navigation.NavigationView
android:layout_width="match_parent"
android:id="#+id/navigationViewLeft"
android:layout_marginTop="30dp"
android:layout_marginBottom="5dp"
android:layout_height="match_parent"
android:layout_gravity="start">
<include
layout="#layout/layout_balises"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</com.google.android.material.navigation.NavigationView>
</androidx.drawerlayout.widget.DrawerLayout >
my Layout_events code :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:clickable="true"
android:id="#+id/layout_evennements"
android:theme="#style/Theme.GPRStest.NoActionBar"
android:layout_height="match_parent"
android:focusable="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/dashmap2"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#color/backgroundcolor"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="#drawable/ic_baseline_close_24"
android:layout_marginStart="15dp"
tools:ignore="ContentDescription" />
</LinearLayout>
<com.gabontech.gprstest.utils.ListViewForEmbeddingInScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ListView
android:id="#+id/listview_evennements"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_below="#id/dashmap2"
android:layout_marginRight="5dp"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="0dp"
android:listSelector="#BFB9AF" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#id/listview_evennements"
android:layout_gravity="center"
android:background="#color/white"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rien_a_voir"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:visibility="gone"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="#string/noEventsData"/>
</RelativeLayout>
</RelativeLayout>
i would like to scroll mylistView but it does not scrolling.i use api to fetch data and display them in my ListView. then onDrawerOpen, ListView shows data but not scrolling. hope someone may help and bring a hand on it.
I was implementing a swipe to refresh the Relative layout inside a drawer layout
.It was all working fine before implementing the swipe to refresh once added it , the recyclerview element is not getting displayed
Am adding my layout below
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.example.pratheesh.madfest_sample.Mainpage"
android:background="#color/feed_bg"
android:id="#+id/drawerlayout"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="#layout/activity_madfext__toolbar"
android:id="#+id/mainpage_toolbar"
>
</include>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="80dp"
tools:context="com.example.pratheesh.madfest_sample.CardRow"
android:background="#drawable/feed_background"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:id="#+id/mainpage_add"
android:layout_below="#+id/mainpage_toolbar"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="#dimen/feed_item_padding_top_bottom"
android:paddingTop="#dimen/feed_item_padding_top_bottom"
android:paddingLeft="#dimen/feed_item_padding_left_right"
android:paddingRight="#dimen/feed_item_padding_left_right" >
<com.example.pratheesh.madfest_sample.AspectRatioImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:src="#drawable/images"
android:id="#+id/mainpage_imageview_profile1"
android:scaleType="fitCenter"
android:layout_centerVertical="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click to add Feeds"
android:id="#+id/mainpage_feeds"
android:textStyle="normal"
android:textColor="#000000"
android:layout_centerVertical="true"
android:layout_toRightOf="#+id/mainpage_imageview_profile1"
android:layout_margin="5dp"
android:layout_marginTop="5dp"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_marginTop="0dp"
android:layout_below="#+id/mainpage_add"/>
</android.support.v4.widget.SwipeRefreshLayout>
</RelativeLayout>
</FrameLayout>
</ScrollView>
<android.support.design.widget.NavigationView
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="#+id/navigationview"
app:menu="#menu/drawer"
app:headerLayout="#layout/activity_navigation_header"
app:itemTextAppearance="#style/NavigationDrawerStyle"
>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
In my activity i need banner, grid-view and slider but the grid-view is not fit to screen after installing app into mobile please help me. here is my xml file.and also set scrollview to all contents in xml.I need output like this screenBut my screen display like this
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="#+id/toolbar"
layout="#layout/toolbar" />
</LinearLayout>
<ViewFlipper
android:id="#+id/flipper1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:flipInterval="3000"
android:inAnimation="#android:anim/slide_in_left"
android:outAnimation="#android:anim/slide_out_right">
<ImageView
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-9dp"
android:contentDescription="ImageOne"
android:src="#drawable/banners" />
<!-- <ImageView
android:src="#drawable/handmadeproducts"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="ImageTwo"
android:layout_gravity="center_horizontal"
/>-->
</ViewFlipper>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<GridView
android:id="#+id/grid"
android:layout_width="fill_parent"
android:layout_height="270dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_margin="30dp"
android:layout_marginTop="-10dp"
android:columnWidth="200dp"
android:gravity="center"
android:horizontalSpacing="25dp"
android:numColumns="3"
android:verticalSpacing="20dp" />
<android.support.v7.widget.RecyclerView
android:id="#+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:scrollbars="none" />
</LinearLayout>
</ScrollView>
</LinearLayout>
<FrameLayout
android:id="#+id/container_body"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<fragment
android:id="#+id/fragment_navigation_drawer"
android:name="com.dk.buyolx.activity.FragmentDrawer"
android:layout_width="#dimen/nav_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"
tools:layout="#layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
I'm trying to add footer at the bottom of my menu (facebook line).
I'm using drawer with recycler view for items in menu.
I have follow this tuto, just mod MyAdapter to detect footer and using footer layout in this case facebook line.
How can I have the last item of menu at bottom ?
Same as this but with recycler view
Just adjust your xml like this
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/grey_dark_menu"
android:elevation="7dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<include
android:id="#+id/tool_bar"
layout="#layout/tool_bar" >
</include>
<FrameLayout
android:id="#+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff" />
</LinearLayout>
<RelativeLayout
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start" >
<android.support.v7.widget.RecyclerView
android:id="#+id/RecyclerView"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#color/grey_dark_menu"
android:scrollbars="vertical" >
</android.support.v7.widget.RecyclerView>
<LinearLayout
android:id="#+id/footer_menu_facebook"
android:layout_width="320dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#508bc3"
android:orientation="horizontal"
android:padding="3dp" >
<ImageView
android:id="#+id/rowIcon"
android:layout_width="34dp"
android:layout_height="34dp"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:src="#drawable/menu_facebook" />
<TextView
android:id="#+id/rowText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_margin="5dp"
android:text="#string/footer_menu_facebook"
android:textColor="#android:color/white"
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>
</android.support.v4.widget.DrawerLayout>
Let me introduce you to my activity:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/toolbar_actionbar"
layout="#layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="#+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_below="#+id/toolbar_actionbar"
android:layout_height="match_parent"/>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar_actionbar">
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:clickable="true"
android:layout_height="match_parent"/>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="#+id/fragment_drawer"
android:name="com.package.name.navigationdrawer.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
FrameLayout main_fragment_container is where I load different fragments depending on Navigation Drawer selections but when I load a fragment with a ScrollView scroll does not work, I can see the scrollbar when the fragment is loaded indicating that only a small section is on screen at the moment but it will never scroll. I tried some suggestions that mentioned encasing the ScrollView inside a LinearLayout, it made no difference.
I suspect the navigation drawer is "intercepting" the events which should reach the ScrollView but I'm lost as to what to do. This is the fragment:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical">
<ScrollView
android:id="#+id/fragment_who_scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:src="#drawable/header_pic_s"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="TEEEEEST"
android:gravity="center"
android:padding="20dp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
Thanks for your time.
UPDATE - LET ME ADD SOME ADDITIONAL INFO:
The problem here is not the ScrollView per se but the fact that in my activity layout the DrawerLayout is 'above' the ScrollView preventing any touch events reaching the ScrollView. If I remove the DrawerLayout the ScrollView scrolls JUST FINE.
Similarly if I put ScrollView after DrawerLayout in activity layout the scroll works alright in the ScrollView but of course the DrawerLayout does not work as intended since it must be on top of everything else.
I hope I explained myself properly, by testing I'm sure of what the problem is but I'm not sure on how to fix it, my experience with Navigation Drawer is limited and I have no idea how to let the scroll event pass to the ScrollView instead of having the DrawerLayout intercept it.
You should move the framelayout with id "main_fragment_container" inside drawerlayout like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/toolbar_actionbar"
layout="#layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar_actionbar">
<FrameLayout
android:id="#+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar_actionbar" />
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="#+id/navigation_drawer"
android:name="vodafone.navdrawertest.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
Try reorder of your layout:
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer"
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">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent“>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
orientation="vertical">
<include
android:id="#+id/toolbar_actionbar"
layout="#layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="#+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<FrameLayout
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</FrameLayout>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="#+id/fragment_drawer"
android:name="com.ulusol.knowmyshop.navigationdrawer.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
Thanks to Thomas for guiding me to the answer.
The FrameLayout where the ScrollView goes must be inside the DrawerLayout to be scrollable. I also ditched the other container Layout because it was not being used. This is how the activity remains:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="#+id/toolbar_actionbar"
layout="#layout/toolbar_default"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<android.support.v4.widget.DrawerLayout
android:id="#+id/drawer"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="#+id/toolbar_actionbar">
<FrameLayout
android:id="#+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_below="#+id/toolbar_actionbar"
android:layout_height="match_parent"/>
<!-- android:layout_marginTop="?android:attr/actionBarSize"-->
<fragment
android:id="#+id/fragment_drawer"
android:name="com.package.name.navigationdrawer.NavigationDrawerFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="#layout/fragment_navigation_drawer"/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
Try adding the following behavior in parent layout:
app:layout_behavior="#string/appbar_scrolling_view_behavior"
I had almost similar issue in AppBarLayout which is under DrawerLayout. This might work.