greenfrvr / hashtag-view

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

Not possible to keep tag order #15

Closed GabrielSchlatter closed 7 years ago

GabrielSchlatter commented 8 years ago

Currently it seems to be impossible to have the tags ordered similar to the input list. It would be great if there was another option for rowDistribution that allows that.

Kenneth-KT commented 8 years ago

I have support for keeping original tag order added into my fork: https://github.com/Kenneth-KT/hashtag-view

Install it with: https://jitpack.io/#Kenneth-KT/hashtag-view/v1.2.2

Use it with:

<com.greenfrvr.hashtagview.HashtagView
...
   app:rowDistribution="none"
...
/>
greenfrvr commented 8 years ago

@Kenneth-KT sorry, but due to my positioning algorithm that will not save original tags order. I mean row distribution affects on already defined rows, but all tags array is sorted in descending order just in the very beginning of positioning before rows are defined, so your PR doesn't really solves the issue. I will try to add something like flag which allows to save order, but I guess it will be better to create some kind of another view with linear tags positioning without any kind of sorting.

GabrielSchlatter commented 8 years ago

@Kenneth-KT I tested with your fork and it works for me, thanks a lot!

drjunior commented 8 years ago

Hi @greenfrvr, thanks for this library. It would be cool if you could add the rowDistribution="none" or something similar that would keep the initial order of the tags. I'm already using your library but just realized now that there is no way to keep the order and now I will have to use another solution in case you don't help me supporting this feature. Thanks for your support.

janakagamini commented 8 years ago

@greenfrvr If you could at least guarantee that given the tags are the same, each time it is drawn in the same view the order will be the same that will be good.

Use case: I have a RecyclerView (the item view layout is always the same) displaying some tags for each item. Even if I hardcode the tag to be the same for each item, the order in which they appear on the screen are different for each item view. (I guess in this case @Kenneth-KT 's solution works.)

csbenz commented 7 years ago

This issue makes the library unusable... it would be good to have a solution, like @Kenneth-KT 's one. Thanks

greenfrvr commented 7 years ago

In v1.3.0 I've added none distribution option and different compose modes (look #22 for more) .