Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions library/src/at/technikum/mti/fancycoverflow/FancyCoverFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,25 @@ protected boolean getChildStaticTransformation(View child, Transformation t) {
return true;
}

@Override
protected int getChildDrawingOrder(int childCount, int i) {
int selectedIndex = getSelectedItemPosition() - getFirstVisiblePosition();

// Just to be safe
if (selectedIndex < 0) return i;

if (i == childCount - 1) {
// Draw the selected child last
return selectedIndex;
} else if (i >= selectedIndex) {
// Move the children after the selected child so as to stack them, order increasing as we approach selected child
return getLastVisiblePosition() - getFirstVisiblePosition() - (i - selectedIndex);
} else {
// Keep the children before the selected child the same
return i;
}
}

// =============================================================================
// Public classes
// =============================================================================
Expand Down