0

I'm using Sliding Up Panel Library for Android by Umano Team. My requirement is a vertical swipe to a second view, without "previewing" the panel on the first, basically a vertical swipe on a drag point (an ImageView).

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

    <!------ First view ------>
    <RelativeLayout
        android:id="@+id/relative_first"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <!------ Bottom drag point ------>
        <ImageView
            android:id="@+id/drag_first_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:background="@drawable/ic_launcher"
            android:gravity="center|bottom" >
        </ImageView>

    </RelativeLayout>

    <!------ Second view ------>
    <RelativeLayout
        android:id="@+id/relative_second"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <!------ Top drag point ------>
        <ImageView
            android:id="@+id/drag_second_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:background="@drawable/ic_launcher"
            android:gravity="center|top" >
        </ImageView>

    </RelativeLayout>

</com.sothree.slidinguppanel.SlidingUpPanelLayout>

The panel has attribute sothree:panelHeight="0dp" so is completely hidden. Initial state has the drag on first view. I've setup a listener to change it on expanded or collapsed:

slidingUpPanelLayout.setPanelSlideListener(new SimplePanelSlideListener() {
    @Override
    public void onPanelCollapsed(View panel) {
        slidingUpPanelLayout.setDragView(dragFirstView);
    }

    @Override
    public void onPanelExpanded(View panel) {
        slidingUpPanelLayout.setDragView(dragSecondView);
    }

});

The problem is I've lost the progressive "dragging" effect, besides swiping up and going over (on y axis) the drag imageview (on first view) results in no transition (I think that the first view intercept the ontouch event). Can you please give me any hints to proceed, or suggest others ways to do that? I really like the library, and I feel to be near the aim. Forgot to say I'm inside a view pager =).

Jumpa
  • 4,319
  • 11
  • 52
  • 100
  • did you find a way to do what you want? I have the same requirement – Fred Mériot Oct 18 '14 at 06:32
  • Unfortunately not. I gave up with this library for this requirement. I'm still looking for an alternative solution. If you're not inside a horizontal view pager, you can think about this solution: http://vision-apps.blogspot.it/2013/05/4-directions-swipe-navigation.html I think I'll go with gesture detection (sigh). Please let me know if you find something simpler. – Jumpa Oct 18 '14 at 09:32
  • Did you look at the SlidingDrawer widget? http://developer.android.com/reference/android/widget/SlidingDrawer.html – Fred Mériot Oct 21 '14 at 09:15
  • It's deprecated isn't it? – Jumpa Oct 22 '14 at 06:10
  • Yes, I just seen it ... So, perhaps a viewPager instead? – Fred Mériot Oct 23 '14 at 06:17
  • You mean a vertical view pager? Yes that's an idea, some libraries implemented that...but I'm already inside an horizontal vp, so it's a mess. – Jumpa Oct 23 '14 at 06:20
  • Are you saying that the second view is not sliding up? – Noah Passalacqua Jan 30 '15 at 14:36

0 Answers0