0

I am trying to create a Left to right sliding drawer over a MapView using this example :

http://www.anddev.org/viewtopic.php?p=16622

But it split the screen in two parts upper side MapView and second part displays the sliding drawer.

Please suggest me how to create a side sliding drawer over the Map..

My result.xml look like following :

    <?xml version="1.0" encoding="utf-8"?>

   <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:panel="http://schemas.android.com/apk/res/com.app.SL"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:background="#767c9b"
       >
<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
     >

   <com.google.android.maps.MapView
    android:id="@+id/myGMap" android:layout_width="fill_parent"
    android:enabled="true" android:clickable="true"
    android:apiKey="0cgwXB2sO7JjQpz_Ho3KFg60hJSL3GjWWAC4yQA"
    android:layout_height="343dp" android:layout_weight="1.26" />


    <com.app.SL.Panel
        android:layout_width="wrap_content" 
        android:layout_height="fill_parent" 
        android:id="@+id/leftPanel2" 
        android:layout_weight="1" 
        android:layout_gravity="left"
        panel:position="left"
        panel:openedHandle="@drawable/left_switcher_expanded_background"
        panel:closedHandle="@drawable/left_switcher_collapsed_background"
     >
        <Button
            android:id="@id/panelHandle" 
            android:layout_width="33dip" 
            android:layout_height="fill_parent"
        />
        <TextView
            android:id="@id/panelContent" 
            android:layout_width="wrap_content" 
            android:layout_height="fill_parent" 
            android:gravity="center"
            android:padding="4dip"
            android:text="This is\nmy second\nleft Panel"
            android:textSize="16dip"
            android:textColor="#eee"
            android:textStyle="bold"
            android:background="#115544"
        />
      </com.app.SL.Panel>
       </LinearLayout>


      </FrameLayout>
Nibha Jain
  • 7,742
  • 11
  • 47
  • 71
  • You can draw sliding drawer from [this](http://blog.sptechnolab.com/2011/02/10/android/android-sliding-drawer/) before that you can take a look at [here](http://blog.pocketjourney.com/2008/03/15/tutorial-1-transparent-panel-linear-layout-on-mapview-google-map/) for more you can try [this](http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html) – Hanry Aug 08 '11 at 10:07
  • thanks hanry..but i want to implement sliding drawer drag-open functionality ....all three links are not for that ..first one is look like sliding drawer but ..that is all about changing the visibility... – Nibha Jain Aug 08 '11 at 10:42
  • @jiya First thing Change your layout to Relative in which map is placed. The problem with LinearLayout is that you forgot to place the weight. Give the android:layout_weight="1" to mapview and android:layout_weight="0" panel layout. – Hanry Aug 08 '11 at 10:55
  • thank u very much hanry..i got the desirable result by just changing Linear Layout to relative layout...your comment is actually my answer..;) – Nibha Jain Aug 08 '11 at 11:24
  • @jiya Any How you gott it.... – Hanry Aug 08 '11 at 11:29
  • @nibha: are you able to create the SliderDrawer that slide from left to right ? If yes then let me know how you have done it. I have posted question here: http://stackoverflow.com/questions/8291639/how-to-make-such-animation-in-android – Android_Developer Nov 28 '11 at 07:22
  • You can see this solution http://stackoverflow.com/a/13985400/716865 – Muhannad A.Alhariri May 01 '13 at 07:42

1 Answers1

0

Dude try my code and you will have your sliding drawer from left to right

<SlidingDrawer
    android:id="@+id/drawer"
    android:layout_width="300dp"
    android:layout_height="match_parent"
    android:content="@+id/content"
    android:handle="@+id/handle"
    android:orientation="horizontal"
    android:rotation="180" >

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent" />

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
    </LinearLayout>
</SlidingDrawer>

</LinearLayout>
Yash Gadle
  • 427
  • 6
  • 14