INNER CODE UNIT · Java
setCharacterIndices
robinhood/ticker · ticker/src/main/java/com/robinhood/ticker/TickerColumn.java:119
private void setCharacterIndices() {
currentCharacterList = null;
for (int i = 0; i < characterLists.length; i++) {
final TickerCharacterList.CharacterIndices indices =
characterLists[i].getCharacterIndices(currentChar, targetChar, metrics.getPreferredScrollingDirection());
if (indices != null) {
this.currentCharacterList = this.characterLists[i].getCharacterList();
this.startIndex = indices.startIndex;
this.endIndex = indices.endIndex;
}
}
// If we didn't find a list that contains both characters, just perform a default animation
// going straight from source to target
if (currentCharacterList == null) {
if (currentChar == targetChar) {
currentCharacterList = new char[] {currentChar};