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

Add default support for arbitrary undefined characters #33

Closed drjunior closed 8 years ago

drjunior commented 8 years ago

Hi, I'm trying to use your library to swap letters which means that I need to use the Greek latin alphabet letters with accents, etc. Right now I just passing as the alphabet the 255 chars from the ascii table, but this is not the best solution because there are chars that have no printable representation and "blurry" also the animation when passing from one char to another...

Do you have a better solution? Thanks.

What I'm doing right now:

alphabetlist = new char[255];
        alphabetlist[0] = TickerUtils.EMPTY_CHAR;
        for (int i = 0; i < 255; i++) {
            alphabetlist[i] = (char) (i);
        }
jinatonic commented 8 years ago

Is it possible for you to enumerate all possible characters that you want to support?

This is an issue that I've been thinking about lately (having a good default fallback case for characters that are not supported), and I might implement it in a way where unknown characters are simply animated 1-space away from the end.

I'll use this ticket to track that work progress. In the mean time, the only current solution is to enumerate all possible characters that you want to support.

drjunior commented 8 years ago

Okiks, thanks!

jinatonic commented 8 years ago

@drjunior you can compile against 1.1.1-SNAPSHOT to get the latest changes.