How to create list with carousel effect in android

2019-07-08 03:05发布

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

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.

2条回答
爷的心禁止访问
2楼-- · 2019-07-08 03:38

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);
    }
查看更多
叛逆
3楼-- · 2019-07-08 03:40

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.

查看更多
登录 后发表回答