question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ChipGroup] Ability to set maximum visible row in Chipgroup

See original GitHub issue

Is your feature request related to a problem? Please describe. Yes, Currently ChipGroup can be populated with all dynamic chip items as expected. But I want to show the items from the list which fits inside maximum of two (variable) lines only. But I can’t find any good solution for this issue I am facing currently.

Describe the solution you’d like A very good solution will be returning the visible row count of the ChipGroup (optional) and limiting the maximum visible row count by using chipGroup.maxVisibleRowCount(2) kind of method. And another enhancement will be filtering the chip items on the basis of best fit in per line/row inside the ChipGroup, which will show the perfect possible fit into the ChipGroup instead of showing asymmetric views and extra spaces end of the line/row.

Describe alternatives you’ve considered I used a fixed height to the ChipGroup and sometimes it breaks the UI on some small screen devices. To resolve this I reduced the list size which also doesn’t serve my purposes well yet. And for the enhancement, I am still working on it.

Additional context Current situation: https://i.stack.imgur.com/hxdJd.png My expectation on this: https://i.stack.imgur.com/Y406w.png

Here is my stackOverflow question link: https://stackoverflow.com/questions/59947859/how-can-i-limit-the-area-of-chip-items-the-wrap-area-to-2-lines-max-inside-the

We also happily accept pull requests.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
rabiuncommented, Nov 4, 2020

I want to put a ChipGroup in a HorizontalScrollView and show only 2 rows. Is there any way to achieve this?

0reactions
drchencommented, Jul 23, 2021

This seems not a general use case but a very specific UX requirement. The suggestion in the linked stackoverflow question seems a good solution to me - or, you can even do it in a simpler way - just wrap the ChipGroup in a fixed height layout.

Since ChipGroup is not officially supported in our spec, there’s a low chance that we will implement this in the near future. However, if you feel strong about supporting this in general, we are glad to accept a pull request.

And about “put a ChipGroup in a HorizontalScrollView and show only 2 rows”, this sound like an even more specific use case to me. How about just creating two ChipGroups and implement the logic to decide which chips you want to put in which group?

Closing the issue for now…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I limit the area of chip items (the wrap area) to 2 lines ...
Is it possible to get the current row count of chip items from the ChipGroup? If yes how? · Can I set the...
Read more >
ChipGroup - Android Developers
Returns the vertical spacing between visible chips in this group. int, getRowIndex(View child). Gets the row index of the child, primarily for ...
Read more >
Minute of Pain #5: ChipGroup functionality | by Michael Spitsin
3. Chip Group is just a simple not smart view group · Either remove and create new views over and over again ·...
Read more >
Android P: Chips and ChipGroup - DigitalOcean
We'll be implementing them in our android application. Android Chips. Chips are basically a text displayed in a rounded background. These are ...
Read more >
Arm (company) - Wikipedia
Arm is a British semiconductor and software design company based in Cambridge, England. Its primary business is in the design of ARM processors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found