INNER CODE UNIT · Java
bottomCharOffsetPercentage
robinhood/ticker · ticker/src/main/java/com/robinhood/ticker/TickerColumn.java:188
final float bottomCharOffsetPercentage = bottomCharPosition - (int) bottomCharPosition;
// We might have interrupted a previous animation if previousBottomDelta is not 0f.
// If that's the case, we need to take this delta into account so that the previous
// character offset won't be wiped away when we start a new animation.
// We multiply by the inverse percentage so that the offset contribution from the delta
// progresses along with the rest of the animation (from full delta to 0).
final float additionalDelta = previousBottomDelta * (1f - animationProgress);
// Now, using the bottom char's offset percentage and the delta we have from the
// previous animation, we can now compute what's the actual offset of the bottom
// character in the column relative to the baseline.
bottomDelta = bottomCharOffsetPercentage * charHeight * directionAdjustment
+ additionalDelta;
// Figure out what the actual character index is in the characterList, and then
// draw the character with the computed offset.
bottomCharIndex = startIndex + ((int) bottomCharPosition * directionAdjustment);