3

Android 프로젝트에 umano AndroidSlidingUpPanel을 사용하고 있습니다. 여기에 Google지도를 주요 콘텐츠로 사용하고 있습니다. 따르는 것은 관련 XML 파일입니다.패널이 기본 패널 높이로 설정된 경우 AndroidUlidingUpPanel의 기본 내용 크기 조정을 중지하는 방법

<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> 

그러나 활동은 내가지도에 마커가 나는 높이를 기본값으로 패널 설정을 클릭 0

slidingUpPanelLayout.setPanelHeight(0); 

에 패널의 기본 높이를 설정 시작할 때.

slidingUpPanelLayout.setPanelHeight(defaultPanelHeight); 

그리고 다시, 나는이,지도가되어 다시 크기를하고있는 중이 야 언제가 0으로 설정되어 패널 높이 (안 마커)지도를 클릭 할 때. 내가 어떻게 그걸 막을 수 있지. 이 기능은 Android 휴대 기기의 Google지도와 동일하게 작동합니다.

답변

3

Bazinga;) 내가 해냈어.

그냥 댓글 495 라인에 (https://github.com/umano/AndroidSlidingUpPanel/blob/master/library/src/com/sothree/slidinguppanel/SlidingUpPanelLayout.java)입니다;

height -= panelHeight; 

당신은 좋습니다. 그러나 Google지도 확대 축소 버튼을 사용하는 경우 Google지도 확대 축소 버튼을 사용할 때 발생할 수있는 단점이 있습니다. 즉, 위로 끌어 당기는 서랍은 해당 버튼을 덮습니다. 그러나 실제 Google지도에서는 ​​이런 일이 일어나지 않을 것입니다.

+0

대단히 감사합니다. 그냥 튀어 나오기보다는 슬라이딩 애니메이션으로 만들 수 있는지 알고 있습니까? Google지도에서와 마찬가지로? – deimos1988

+0

@ deimos1988 시도하지 않았습니다. 내가 원한다면이 스레드를 업데이트 할 것입니다. – AnujAroshA

+0

나는 이것에 관한 질문을했다. (http://stackoverflow.com/questions/22616605/umano-android-slidinguppanel-animation) 당신이 해결책을 가지고 있다고 생각한다면, 대답은 대단히 감사하게 될 것이다. – deimos1988