robinhood / ticker

An Android text view with scrolling text change animation
https://medium.com/robinhood-engineering/hello-ticker-20eaf6e51689
Apache License 2.0
4.38k stars 462 forks source link

Implement Levenshtein distance algorithm to compute min edit distance #20

Closed jinatonic closed 8 years ago

jinatonic commented 8 years ago

Implement a modified version of Levenshtein distance algorithm (https://en.wikipedia.org/wiki/Levenshtein_distance) to compute how we should transition from one string to the next. This algorithm will allow us to make the minimum number of column changes for when the length of the text changes.

A side effect of this behavior is it will preserve the common elements in the string, e.g. for currency formats animating from $1234.55 to $234.76 will be much smoother.

danh32 commented 8 years ago

lgtm. just need to resolve merge conflicts, then good to go!