distanceToIndexSnap

abstract fun distanceToIndexSnap(index: Int): Int

Calculate the distance in pixels needed to scroll to the given index. The value returned signifies which direction to scroll in:

  • Positive values indicate to scroll towards the end.

  • Negative values indicate to scroll towards the start.

If a precise calculation can not be found, a realistic estimate is acceptable.

Sources

Link copied to clipboard