greenfrvr / hashtag-view

Android fully customizable widget for representing data like hashtags collection and similiar.
MIT License
337 stars 54 forks source link

ArrayIndexOutOfBoundsException in HashtagView #32

Closed zunjae closed 7 years ago

zunjae commented 7 years ago

Unfortunately I can't find any documentation on how to use the new Lineair compose mode, so I've just been playing around a bit, but I'm getting this error.

My Code:

        ArrayList<XXX> genres = YYY.getAllGenres();
        // Load data into view
        hashtagView.setData(genres, new HashtagView.DataTransform<XXX>() {
            @Override
            public CharSequence prepare(XXX item) {
                // code here
                return spannableString;
            }
        });
        hashtagView.setComposeMode(HashtagView.COMPOSE_LINEAR);

Error:

java.lang.ArrayIndexOutOfBoundsException: length=9; index=9
at com.greenfrvr.hashtagview.HashtagView$LinearComposer.evaluateRowsQuantity(HashtagView.java:923)

line 923 in HashtagView:

rowsWidth[rowsCounter] += item;