GlFancyCoverFlow icon indicating copy to clipboard operation
GlFancyCoverFlow copied to clipboard

设置了负的Spacing后, 后面的Item盖住了前面的

Open com314159 opened this issue 9 years ago • 1 comments

假如现在是选中的是3, 3应该盖住4,但是实际上却是4盖住了3, 能不能修复这个bug

com314159 avatar Mar 06 '15 03:03 com314159

@Override
protected int getChildDrawingOrder(int childCount, int i) {

    int selectedIndex = getSelectedItemPosition() - getFirstVisiblePosition(); 


    if (i < selectedIndex) {
        return i;
    } else if (i >= selectedIndex) {
        return childCount - 1 - i + selectedIndex;
    } else {
        return i;
    }
}

修改这个函数成这样, 就可以修复这个问题

com314159 avatar Mar 06 '15 04:03 com314159