SlidingPaneLayout slide pane overhanging main pane

578 views Asked by At

Hi I am building a map app and trying to have it so when you hit click on a maker it opens the sliding pane. It works just the way i want but when the pane is closed you can still see a bit of it overhanging. I want to hide that off the screen so all you see is the map fragment.

activity_main.xml

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

<android.support.v4.widget.SlidingPaneLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sliding_layout"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" >

<fragment
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/map"
    android:layout_width="fill_parent"
    android:layout_height="match_parent"    
    android:layout_margin="0dp"

    class="com.google.android.gms.maps.SupportMapFragment" />

     <fragment
        android:id="@+id/photo"
        android:name="com.example.mapapp.SliderFragment"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:layout_margin="0dp"  />

  </android.support.v4.widget.SlidingPaneLayout>

see the below image

enter image description here

1

There are 1 answers

0
Justin On

I know this is a really late answer, and you probably found a solution already, but the functionality you want sounds to me like a drawer layout. You can find out more about how to implement that from these official Android docs:

https://developer.android.com/training/implementing-navigation/nav-drawer.html https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html