Android SlidingDrawer from top?
The default SlidingDrawer
class doesn't allow this. You can use the Panel
class from here to get something very similar though:http://code.google.com/p/android-misc-widgets/
http://www.ohloh.net/p/android-misc-widgets
Android : sliding drawer from top
Refer to this library: Link
There are instructions about how to make this panel slide from top in the readme file.
Sliding drawer - how to make it pull from above?
If the top purple drawer is a RelativeLayout
, just set in the button the ALIGN_PARENT_TOP
to true
. If the drawer is not a RelativeLayout
, declare one RelativeLayout
(which fills all the purple drawer) inside it and put in it the button with ALIGN_PARENT_TOP
to true
.
Then, for having the text in the button upside down, just add android:rotation="180"
to the button in your XML file or give the button a 180 degree rotation programatically.
How to change android slidingdrawer handle button position
Put your handle in a RelativeLayout, and set android:layout_alignParentRight="true" on the handle.
For example like this:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<SlidingDrawer android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:handle="@+id/handle"
android:content="@+id/content">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/handle">
<ImageView android:src="@drawable/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
</RelativeLayout>
<LinearLayout
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#aaaa00" android:id="@+id/content">
<ImageView android:src="@drawable/icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
</ImageView>
</LinearLayout>
</SlidingDrawer>
</FrameLayout>
SlidingDrawer doesn't slide over the top of ListView
Make your root a RelativeLayout, and have both the child Linear Layout and the SlidingDrawer fill_parent for height.
A LinearLayout can't have two views that overlap.
Is there a way to implement a top down sliding drawer
You can try umano's https://github.com/umano/AndroidSlidingUpPanel. Just copy it and see if it fits
Android SlidingDrawer on top of the notification bar (or toggle visibility of that one)
You cannot draw Views on top of the notification bar. You can hide it by making your application fullscreen, but that's all.
Related Topics
How to Animate a Path on an Android Canvas
How to Give Hexagon Shape to Imageview
How to Get Contacts' Phone Number in Android
Apk Location in New Android Studio
How to Detect When the User Has Changed the Clock Time on Their Device
Apply Custom Filters to Camera Output
Horizontalscrollview Inside Swiperefreshlayout
Android: Overlay on Android Camera Preview
Hiding Title in a Fullscreen Mode
How to Write Outputs to the Log in Android
Setresult Does Not Work When Back Button Pressed
Extract Code Country from Phone Number [Libphonenumber]
All Com.Android.Support Libraries Must Use the Exact Same Version