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

Tell me what am I doing wrong! #51

Closed lazarusvc closed 7 years ago

lazarusvc commented 7 years ago

I've implemented this into my project, but it doesn't seem to work. Can you tell me what am I doing wrong? see code below... final TickerView tickerView = (TickerView) findViewById(R.id.tickerView); tickerView.setCharacterList(TickerUtils.getDefaultNumberList()); String[] ticker_content = {"Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet"}; int idx = new Random().nextInt(ticker_content.length); tickerView.setText(ticker_content[idx]);

PS: I've added the .xml view and gradle lib

jinatonic commented 7 years ago

You are using setDefaultNumberList which only animates numbers, but your content is normal strings. See TickerUtils on other types of character lists or create your own.