Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Vertical carousel #3

@venkatadineshk

Description

@venkatadineshk

Can vertical carousel functionality be implemented? I got some success in changing the direction by manipulating
private void calculateItemPosition(final CarouselItemHolder child, float angleDegree) {

    float scale = calculateItemScale(angleDegree);


    angleDegree = angleDegree * (float)(Math.PI/180.0f);


    float x = 0.0f;
    float y = (float) (mCarouselDiameter / 2 * Math.sin(angleDegree)) + mCarouselDiameter / 2 - child.getWidth() / 2;
    float z = mCarouselDiameter / 2 * (1.0f - (float) Math.cos(angleDegree));


    child.setItemX(x);
    child.setItemZ(z);
    child.setItemY(y);
    child.setItemScale(scale);
    child.setItemAlpha(angleDegree, mCarouselOptions.getMinAlpha());
}

but the scroll direction is still horizontal I tried to change mIsHorizontalScroll to true but didn't help. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions