0

The following XML allows both a Streetside view and a map to be displayed on one of the pages of my ViewPager...

<LinearLayout
    android:id="@+id/map_container2"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="0.5"
    android:orientation="vertical">

    <fragment
        android:id="@+id/streetviewpanorama"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.5"
        class="com.google.android.gms.maps.SupportStreetViewPanoramaFragment" />

    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.5"
        class="com.google.android.gms.maps.SupportMapFragment"
        map:cameraTargetLat="-33.87365"
        map:cameraTargetLng="151.20689"
        map:cameraZoom="15" />
</LinearLayout>

This works ok but I want to provide a "sliding" capability so the the user can put his finger on the line between the two maps and, for instance, slide the dividing line up to show less streetview and more map. Or the reverse.

If no street view is available at the given coords then I would want to programatically make the street view fragment gone which I realize I can do with the existing layout.

EDIT: BTW the SlidingPanelLayout won't do the job because it has trouble with other gestures available on the map.

Is there a widget that will do this? Thanks, Dean

Dean Blakely
  • 3,535
  • 11
  • 51
  • 83
  • why don't you increase the space between the Map and the StreetView, that space can intercept the touch to collect the swapping gesture so you can see it sliding – Pankaj Nimgade Mar 08 '16 at 19:25
  • Pankaj: that would be my last alternative if none of the existing controls will do the job. – Dean Blakely Mar 11 '16 at 15:50

0 Answers0