ListView with custom CellFactory trims invisible nodes

Taking from @dlatikay’s comment, instead of setting the placeholder items to invisible, you can render them transparent by setting their opacity to 0.0.

Applied to the MCVE from your question, this would be done by replacing:

tabShape.setVisible(item);

with:

tabShape.setOpacity(item ? 1.0 : 0.0);

In terms of user experience, you could take this one step further. Instead of setting the “inactive” stars to fully transparent, you could set them to be near-transparent, as in this mockup (with opacity set to 0.1):

mockup

The benefits that I see are:

  1. It indicates not only the rating of an item in the list, but also the maximum rating.
  2. It avoids awkward empty spaces for list items with zero stars.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)