How to create list with carousel effect in android

我的梦境 提交于 2019-12-11 03:39:56

问题


I've gone through with many solutions but still looking for best. I want to do something like

This should be a list containing custom cells and it shall be showing one view highlighted at one time and two adjacent views(pre/post) must be shown slightly.

If anybody have any experience in this work please share. Any help would be highly appreciated.


回答1:


Are you open to html5/hybrid solutions ? There are many libraries in the market that does the work for you. In case you need some on android platform, you have to explore the animation framework and create a custom all by yourself.




回答2:


for detail visit

private void Calculate3DPosition(CarouselItem child, int diameter,
            float angleOffset) {
        angleOffset = angleOffset * (float) (Math.PI / 180.0f);
        float y = (float) (diameter / 2 * Math.sin(angleOffset)) + diameter / 2
                - child.getWidth() / 2;
        float z = diameter / 2 * (1.0f - (float) Math.cos(angleOffset));
        float x = (float) (-   diameter / 2 * Math.cos(angleOffset) * 0.5);
        child.setX(x + 250);
        child.setZ(z);
        child.setY(y - 150);
    }


来源:https://stackoverflow.com/questions/19508936/how-to-create-list-with-carousel-effect-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!