문제

I have implemented a SlidingPaneLayout with fragments that looks like this (summarizing)

<SlidingPaneLayout
    android:xmlns="...."
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >


    <ListView />
    <FrameLayout />
</SlidingPaneLayout>

So the ListView is the "slide out" pane. It all works fine and exactly as I expect it to.

However, I'm interested in achieving the animate affect (where the ListView would come in from the left as the pane is pulled out, following the touch)

I've tried making a slide_in_left anim resource and setting it as a LayoutTransition, however this doesn't behave like I want it to. Guessing I need to do something with onPaneSlide?

Just wondering if there's a good way to implement this with SlidingPaneLayout, thanks!

도움이 되었습니까?

해결책

Wow it's too easy I just overlooked it big time.

SlidingPaneLayout has a method, setParallaxDistance, which adds the effect I was referring to.

http://developer.android.com/reference/android/support/v4/widget/SlidingPaneLayout.html#setParallaxDistance(int)

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