I have downloaded the umano sliding up panel from https://github.com/umano/AndroidSlidingUpPanel
Imported it into the workspace and added reference to it in my project.
Next I copied and pasted the following into a new layout -
Here is the Code :
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="68dp"
sothree:shadowHeight="4dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text="The Awesome Sliding Up Panel"
android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
But I am getting an error unbound prefix.
What is wrong in my code?
And How can i fix this ?
You are missing namespace for android
Also this
xmlns:sothree="http://schemas.android.com/apk/res-auto"
Should be
xmlns:sothree="http://schemas.android.com/apk/res/yourpackagename"
So it should be
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res/yourpackagename"
considering you have custom attributes
Edit:
Looks like you are using
https://github.com/umano/AndroidSlidingUpPanel
Its a library project and you must reference it in your andorid project. Scodnly missing android namespace as mentioned. The below should fix it
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
tools:context=".MainActivity" >
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="68dp"
sothree:shadowHeight="4dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text="The Awesome Sliding Up Panel"
android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</RelativeLayout>
You can use BottomSheetBehavior from android support library from google as alternative. compile 'com.android.support:design:25.0.0'
You can checkout my sample https://github.com/andrisasuke/Android-SlidingUp-Panel
I also implemented a SlidingUpPaneLayout, based on the SlidingPaneLayout, but the slide direction is
vertical you can slide up and down for the top view, it's more simple,just two views and no more attribute need to set.see at github,https://github.com/chenjishi/SlidingUpPaneLayout
<?xml version="1.0" encoding="utf-8"?>
<com.chenjishi.slideupdemo.SlidingUpPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/sliding_up_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="#+id/bottom_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#FFF"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="BOTTOM"
android:textSize="18sp"
android:textColor="#333"/>
</LinearLayout>
<LinearLayout
android:id="#+id/top_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:background="#009588"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TOP"
android:textSize="18sp"
android:textColor="#333"/>
</LinearLayout>
If you want to slide your main body along with sliding part then only then add
umanoParallaxOffset attribute otherwise remove it
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/hidden_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:gravity="bottom"
sothree:umanoClipPanel="false"
sothree:umanoDragView="#+id/dragView"
sothree:umanoFadeColor="#android:color/transparent"
sothree:umanoOverlay="true"
sothree:umanoPanelHeight="#dimen/_69sdp"
sothree:umanoShadowHeight="#dimen/_4sdp">
//Main body content
<FrameLayout
android:id="#+id/main_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Body...........
</FrameLayout>
//Sliding content
<FrameLayout
android:id="#+id/main_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Body...........
</FrameLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
Don't forget it!
sothree:umanoOverlay="true"
<style name="AppTheme">
<item name="android:windowActionBarOverlay">true</item>
</style>
you are getting unbound prefix error means you are done with referencing the library, you just need to modify xmlns attributes and make the slidingUpPanelLayout the root and you are done. dont't forgot to change "com.example.slidinguppanel" with your package name.
Hope it will fix your problem.
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sothree="http://schemas.android.com/apk/res/com.example.slidinguppanel"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:panelHeight="68dp"
sothree:shadowHeight="4dp">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Main Content"
android:textSize="16sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|top"
android:text="The Awesome Sliding Up Panel"
android:textSize="16sp" />
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
Related
I have updated my android studio. In my layout preview my design is not showing it says
NOTE: One or more layouts are missing the layout_width and layout_height attributes, required in most layouts.
OR: Automatically add all missing attributes. There is no error in application. It's running well. I have uninstalled my android studio but same issue occurred. In all my projects occurs the same issue.
I have updated SDK as well.
Here is layout.xml
<?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:local="http://schemas.android.com/apk/res-auto"
android:id="#+id/coordinate_layout_sheet"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar_series"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/colorPrimaryDark"
local:popupTheme="#style/ThemeOverlay.AppCompat.Light"
local:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
</android.support.v7.widget.Toolbar>
<android.support.v4.widget.NestedScrollView
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.support.v4.widget.NestedScrollView>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ProgressBar
android:id="#+id/pb_product"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="visible" />
<TextView
android:id="#+id/tv_no_record"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center"
android:text="No record Found"
android:textSize="18sp"
android:visibility="visible" />
</RelativeLayout>
<!-- <android.support.v4.widget.NestedScrollView
android:id="#+id/bottom_sheet_registration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:clipToPadding="true"
android:visibility="gone"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="14dp"
android:orientation="vertical">
<include layout="#layout/bottomsheet" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>-->
<View
android:layout_width="match_parent"
android:layout_height="60dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:id="#+id/btn_add_tocart"
style="#style/Base.Widget.AppCompat.Button.Colored"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:backgroundTint="#863029"
android:text="Add To Cart"
android:textAllCaps="false" />
</RelativeLayout>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
This happens to me sometimes. What I do to fix this is to check styles.xml from res folder and check that the style AppTheme is correctly defined.
For example, if I want my app style to be without action bar, I use this as AppTheme:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...
and add required items such as colorPrimary etc.
Then after rebuilding the gradle I usually can see my layout design again
One of the possibility is that your Theme changes. Try changing it to Material -> Dark in the Preview view.
Link to the similar topic:
android studio preview not displaying? version 1.5.1
I'm trying to do a Widget with a ListView, but I want to show the ScrollBar really in the right side, without any padding.
I want it like the gmail calendar Widget. I will show you how with pictures:
This is my Layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<FrameLayout android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:id="#+id/widgetTitle"
android:textColor="#color/colorWhite"
android:background="#drawable/widget_title_background"
android:textSize="15dp"
android:gravity="center"
android:layout_height="#dimen/widget_title_min_height"></TextView>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="0dp"
android:background="#color/colorWhite">
<ListView
android:id="#+id/widgetListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="0dp"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
tools:listitem="#layout/widget_list_item"></ListView>
</LinearLayout>
</LinearLayout>
In Listview control scrollbar default show on right side always.
Try This code ..
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/listview"></ListView>
i have an app that uses tabs to show different content..... there is an admob banner below the tabs that should never move..... it should be locked to the bottom of the screen...........
most of the content is shown using activity_main.xml which includes content_main.xml using and i have never had a problem with the layout before..... everything fit fine.....
here is what the layout is SUPPOSE to look like....
i recently added a new tab and java file called bpm counter....
the bpm counter tab has its own layout and doesn't use activity_main.xml or the content_main.xml instead it uses its own activity_main2.xml and everything is sort of working but here is the problem....
when i open the app everything looks normal like it always has with the banner at the bottom of the page.... however when i click the bpm counter tab the admob banner moves down and goes half way of the screen....... then when i try to go back to any other tab the banner moves wayyy up and i get a white space below the admob banner
you can see the problem of the banner moving down when i visit the bpm tab here
and then when i try to go back to the home page or any other tab the banner moves way up... as you can see in the photo below
i have tried changing match_parent and fill_parent and have tried a lot of tweak in the layout but i can not figure out what i am doing wrong and i am about to bang my head off a wall.... any help would be wonderful and appreciated!
here are my .xml layout files
activity_main.xml
<?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"
android:fitsSystemWindows="true"
tools:context="com.raptools.app.raptools.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<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/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_main" />
</android.support.design.widget.CoordinatorLayout>
here is my content_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:screenOrientation="portrait"
android:background="#000000"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
tools:context="com.raptools.app.raptools.MainActivity"
tools:showIn="#layout/activity_main">
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="0dp"
android:layout_height="0dp"
android:screenOrientation="portrait"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-4075500144464557/8371434413"/>
<WebView
android:id="#+id/activity_main_webview"
android:layout_width="match_parent"
android:screenOrientation="portrait"
android:layout_height="match_parent"
android:layout_above="#id/adView" />
<ImageView
android:id="#+id/homepageimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="#drawable/homepageimage"
android:layout_above="#id/adView"
/>
<ImageView
android:id="#+id/comingimage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitCenter"
android:src="#drawable/comingsoon"
android:layout_above="#id/adView" />
</RelativeLayout>
those two layout files were working fine until i tried to add the new bpm counter tab......
here is the activity_main2.xml that is used for the bpm counter java
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true"
tools:context="com.raptools.app.raptools.MainActivity"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:textColor="#color/ColorRemoveAds"
app:itemIconTint="#color/ColorRemoveAds"
app:popupTheme="#style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:id="#+id/appView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#drawable/transitioning_background"
android:orientation="vertical"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".BpmCounter">
<TextView
android:id="#+id/bpmLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/bpm"
android:textColor="#color/textColor"
android:textSize="40sp"/>
<TextView
android:id="#+id/bpmTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bpmLabelTextView"
android:layout_centerHorizontal="true"
android:text="#string/initial_bpm_value"
android:textColor="#color/textColor"
android:textSize="70sp"/>
<Button
android:id="#+id/tapButtonView"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_above="#+id/instructionalLabelTextView"
android:layout_centerHorizontal="true"
android:layout_marginBottom="32dp"
android:background="#drawable/round_button"
android:text="#string/tap"
android:textColor="#color/textColor"
android:textSize="30sp"/>
<TextView
android:id="#+id/instructionalLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="28dp"
android:text="#string/reset_instructions"
android:textColor="#color/textColor"/>
</RelativeLayout>
</LinearLayout>
i hope i have explained in enough detail and any help would be amazing!
i ended up staring at the three codes i posted above for a long time and decided to copy the frame from activity_main.xml pasted it in the activity_main2.xml and removed the linear layout and made sure to include android.support.design.widget.CoordinatorLayout and i managed to get it working!
here is the working code incase anyone has this problem ever
activity_main2.xml
<?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"
android:fitsSystemWindows="true"
tools:context="com.raptools.app.raptools.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="#style/AppTheme.AppBarOverlay">
<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/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<RelativeLayout
android:id="#+id/appView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:screenOrientation="portrait"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_weight="1"
android:background="#drawable/transitioning_background"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context=".BpmCounter">
<TextView
android:id="#+id/bpmLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:text="#string/bpm"
android:textColor="#color/textColor"
android:textSize="40sp"/>
<TextView
android:id="#+id/bpmTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/bpmLabelTextView"
android:layout_centerHorizontal="true"
android:text="#string/initial_bpm_value"
android:textColor="#color/textColor"
android:textSize="70sp"/>
<Button
android:id="#+id/tapButtonView"
android:layout_width="100dp"
android:layout_height="80dp"
android:layout_above="#+id/instructionalLabelTextView"
android:layout_centerHorizontal="true"
android:layout_marginBottom="32dp"
android:background="#drawable/round_button"
android:text="#string/tap"
android:textColor="#color/textColor"
android:textSize="30sp"/>
<TextView
android:id="#+id/instructionalLabelTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="28dp"
android:text="#string/reset_instructions"
android:textColor="#color/textColor"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
I just started playing with com.sothree.slidinguppanel.SlidingUpPanelLayout in the following layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.rburgosnavas.droidfs.MainActivityFragment"
android:id="#+id/main_list_rec"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="#layout/toolbar_main"/>
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="#+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="68dp"
sothree:umanoShadowHeight="4dp"
sothree:umanoParalaxOffset="100dp"
sothree:umanoDragView="#+id/dragView"
sothree:umanoOverlay="true"
sothree:umanoScrollableView="#+id/swipe_refresh_rec"
>
<!-- Main content -->
<android.support.v4.widget.SwipeRefreshLayout
android:id="#+id/swipe_refresh_rec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</android.support.v4.widget.SwipeRefreshLayout>
<!-- Draggable view -->
<LinearLayout
android:id="#+id/dragView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/bright_foreground_material_dark"
android:orientation="vertical"
android:clickable="true"
android:focusable="false">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="LOL-LOL-LOL-LOL-LOL"
/>
</LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
</LinearLayout>
The issue I'm facing is that the RecyclerView doesn't always respond to scroll events, and I'm starting to think that my layout hierarchy may be wrong. I haven't done anything on the Java side with SlidingUpPanelLayout as I just wanted to start simply, and I don't think that's an issue.
Does any have any pointers?
Does anyone know how to do this?!?
I have looked everywhere online for 3 days now and every single tutorial only shows you how to make the drawer, but the problem is actually PUTTING THINGS AS THE LAYOUT for each selected item.
Please Help!
I am not sure if this is the exact answer you are looking for but I built a Navigation Drawer with the AppCompat (ActionBarActivity) library. I have also added things like spinners (drop down lists) into the Nav Drawer XML for a different screen.
Note: In this example I actually add entries programmatically into the XML but the XML is the framework for the drawer. I essentially make a vertical linear layout, scrollable list of links under id externalLinks.
Disclaimer: The purist Material Design person will note that my navigation drawer is below the action bar but I like the little hamburger -> arrow icon that is provided and didn't want to cover it up. The difference is the layout_MarginTop of actionBarSize.
Hope this helps!
<?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"
android:id="#+id/drawerLayout"
android:background="#color/background"
>
<!-- The main content view -->
<LinearLayout
android:id="#+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include layout="#layout/common_toolbar"/>
<ScrollView
android:id="#+id/login_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<!-- There is a bunch of layout that I removed because it is just my app's screen and isn't part of the answer -->
</LinearLayout>
</ScrollView>
</LinearLayout>
<!-- The navigation drawer -->
<LinearLayout
android:layout_marginTop="?attr/actionBarSize"
android:id="#+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="#android:color/transparent"
android:dividerHeight="1dp"
android:background="#color/background"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="#color/colorAccent"
/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/background"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="#+id/navMoreTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/navExternal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:paddingEnd="5dp"
android:minHeight="30dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
android:background="#color/white"
/>
<LinearLayout
android:id="#+id/externalLinks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#color/background"
>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</android.support.v4.widget.DrawerLayout>