2

I am using this library from umanoAndroidSlidingUpPanel and it works fine theres just a problem I cant fix. the main child is a mapview (static main view) that is working fine and the second child (the slidinguppanel) is a responsive html file in a webview and an imageview. the problem is that when I swipe up to slide the panel i cant scroll the html file inside the webview. the library states that I can make a single view draggable so that I can scroll the other but i really dont know how to do it help would be really appreciated. heres my xml file

<com.sothree.slidinguppanel.SlidingUpPanelLayout
    xmlns:sothree="http://schemas.android.com/apk/res-auto"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/sliding_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="bottom"
    sothree:panelHeight="50dp"
    sothree:shadowHeight="4dp">

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

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

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity ="center_horizontal"
            android:src="@drawable/divider">
        </ImageView>

        <WebView
            android:layout_width="match_parent"
            android:id="@+id/desc"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:paddingBottom="7dp"/>
    </LinearLayout>
</com.sothree.slidinguppanel.SlidingUpPanelLayout>
Luke Willis
  • 8,429
  • 4
  • 46
  • 79
drilonrecica
  • 327
  • 1
  • 4
  • 19
  • It says that `By default, the whole [sliding up] panel will act as a drag region and will intercept clicks and drag events. You can restrict the drag area to a specific view by using the setDragView method or dragView attribute.` It means that you can define one view inside the sliding up panel one to become the drag view to intercept clicks and drag events for the sliding up panel. In this case, the ImageView. With this solution, it will not interfere the action events for your Webview – ecle Oct 13 '14 at 01:39
  • Or, it could be that you need to put Webview inside a ScrollView http://stackoverflow.com/questions/6253444/android-webview-scrollable or http://stackoverflow.com/questions/13257990/android-webview-inside-scrollview-scrolls-only-scrollview/13353874#13353874 – ecle Oct 13 '14 at 01:46

1 Answers1

1

I fixed it I just had to call the library method for setting the dragview and set only the imageview as draggable so the webview would scroll normally, heres how I did it:

     ImageView image=(ImageView)findViewById(R.id.divideri); //Layout to slide  
    SlidingUpPanelLayout layout = (SlidingUpPanelLayout)
    findViewById(R.id.sliding_layout); 


    layout.setDragView(image); 

Over and out ...

drilonrecica
  • 327
  • 1
  • 4
  • 19