I was playing around try to implement sliding functionality like in Duolingo Activity with horizontal lessons list. The link to screen capture of this functionality LINK.
With horizontal slider the sliding has no such effects. What will be the proper way to implement such UX sliding widget?
Could I costumize the default ListView with adding the transition effect? Or could be it possible to do it with CardView? Do some external lib offer this like twoway-view?
Use classic ViewPager to show content and then apply to pager this PageTransformer:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
mPager.setPageTransformer(false, new ViewPager.PageTransformer() {
@Override
public void transformPage(View page, float position) {
final float normalizedposition = Math.abs(Math.abs(position) - 1);
page.setScaleX(normalizedposition / 2 + 0.5f);
page.setScaleY(normalizedposition / 2 + 0.5f);
}
});
}
This is the exact requirement for your postings. Kindly go through this URL https://github.com/davidschreiber/FancyCoverFlow. Download the zip and run the sample. Enjoy!! Its easy to customize too...
来源:https://stackoverflow.com/questions/28025433/android-sliding-items-horizontal-like-in-duolingo-app