문제

I am using umano AndroidSlidingUpPanel in my Android project. Here I am using Google Map as my main content. Follow is the relevant XML file.

<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=".DemoActivity" >

    <com.mypkg.name.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:layout_gravity="bottom"
        sothree:collapsedHeight="78dp"
        sothree:dragView="@+id/linLayout"
        sothree:shadowHeight="4dp" >

        <FrameLayout
            android:id="@+id/activity_single_fragment_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#0000FF" >

            <fragment
                android:id="@+id/map_fragment"
                android:name="com.google.android.gms.maps.SupportMapFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />
        </FrameLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#eee"
            android:clickable="true"
            android:focusable="false"
            android:orientation="vertical" >

            <RelativeLayout
                android:id="@+id/drawerListItemProfile_relativeLayout"
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:background="@drawable/drawer_profile_selector" >

                <FrameLayout
                    android:id="@+id/imgFrameLayout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:layout_margin="5dp" >

                    <ImageView
                        android:id="@+id/drawerListItemProfile_imageView"
                        android:layout_width="@dimen/nav_profile_circle_size"
                        android:layout_height="@dimen/nav_profile_circle_size"
                        android:contentDescription="@string/contentDescription_drawer_profile_pic"
                        android:scaleType="centerCrop"
                        android:src="@drawable/profilepic" />
                </FrameLayout>
            </RelativeLayout>

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:scaleType="fitStart"
                android:src="@null" >
            </ImageView>
        </LinearLayout>
    </com.mypkg.name.SlidingUpPanelLayout>

</RelativeLayout>

But when the Activity begins I set the default height of the panel to 0.

slidingUpPanelLayout.setPanelHeight(0);

When a Marker on the map is clicked I set panel to default height.

slidingUpPanelLayout.setPanelHeight(defaultPanelHeight);

And again, when I click on the map (not on a Marker) panel height is set to 0. When I am doing this, Map is re-sizing. How can I stop that. I want this feature works just as in Google Maps in Android mobile device.

도움이 되었습니까?

해결책

Bazinga ;) I did it.

Just comment 495 line in (https://github.com/umano/AndroidSlidingUpPanel/blob/master/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java) which is;

height -= panelHeight;

and you are good to go. But you will get possible drawback when you use Google Maps zoom-in zoom-out buttons if you use them. That is, the sliding up drawer will cover those buttons. But in real Google Maps it wont happen.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top