问题
I found a library, this library supports vertical scrolling cards, I want to change this library according to my needs (Horizontal scrolling). Can anyone suggest how to implement Cards just like the mentioned library cards horizontally.
回答1:
Guys I just found a library, which helped me to solve this issue.
Carousel Library
Best Library I found which I customized for my project:
https://github.com/applm/CarouselWidget
Other helpful libraries: https://github.com/davidschreiber/FancyCoverFlow
https://android-arsenal.com/details/1/3289
I hope, this answer may help you in finding solution.
回答2:
As I always suggest to ask an author and this time I'm the author of this library, I'll tell you what to do.
RecentsList is very simple and the only place you have to change is here: https://github.com/ZieIony/MaterialRecents/blob/master/app/src/main/java/tk/zielony/materialrecents/RecentsList.java#L127 . This method layouts cards inside container. You have to write your own layouting logic.
Why I don't implement that change? Because I'm not sure what do you mean by horizontal cards. Lollipop in landscape orientation shows vertical cards (at least the one I have on my desk).
The second reason is that I think I should rewrite this library from scratch. It was just an experiment with custom layouting code. Correct implementation would use view reusing and recycling just like RecyclerView and ListView do.
来源:https://stackoverflow.com/questions/36622248/horizontal-scrolling-cards-just-like-recent-apps-of-lollipop-in-android