mxn21 / SlidingCard

Sliding cards with pretty gallery effects.

Home Page:http://android-arsenal.com/details/1/2355

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add SlidingCard with Fragment !

Noobknight opened this issue · comments

Hi ! :)
First, you've provided a library very useful and I'm thank for that ^^!
And you can support SlidingCard with Fragment ?

commented

you can use it in Fragment the same with in Activity.
do you mean this?

But.. when i use Fragment it not sliding cards...

class cast exception when using in fragment

@adavanayyappan Fix error it by change params in function initCardView to public void initCardView(final Fragment fragment,int layoutId,int rootId)
It work fine... But card not sliding !

thanks @Noobknight you fix the error its working nicely

commented

do you put the SlidingCard in listview or viewpager?

used in fragment oncreate view thanks for nice tutorial

@adavanayyappan Working... But you can sliding cards (can Touch card ? )

commented

@Noobknight if you put it in scrollable viewgroup like listview ,viewpager etc...sliding will not work .
Solution is don't use 'compile 'com.mxn.soul:slidingcard-core:1.2.0' ' and copy the library to your application. then see the Annotation

// private ViewPager mPager;
// private ListView listView;

// public void setPagerAndListView(ViewPager mPager, ListView listView) {
// this.mPager = mPager;
// this.listView = listView;

// @OverRide
// public boolean dispatchTouchEvent(@nonnull MotionEvent ev) {
// mPager.requestDisallowInterceptTouchEvent(true);
// listView.requestDisallowInterceptTouchEvent(true);
// return super.dispatchTouchEvent(ev);
// }
// @OverRide
// public boolean onInterceptTouchEvent(MotionEvent ev) {
// mPager.requestDisallowInterceptTouchEvent(true);
// listView.requestDisallowInterceptTouchEvent(true);
// return super.onInterceptTouchEvent(ev);
// }
// @OverRide
// public boolean onTouchEvent(@nonnull MotionEvent event) {
// mPager.requestDisallowInterceptTouchEvent(true);
// listView.requestDisallowInterceptTouchEvent(true);
// return super.onTouchEvent(event);
// }

@mxn21 OK... I will try again :)

yes its working i can slide the cards @Noobknight

@adavanayyappan, @mxn21 working fine :)

can i swipe cards vertically @mxn21

commented

@adavanayyappan no ,sadly , only drag horizontally so far

its ok thanks for your nice library @mxn21