material-components-android
material-components-android copied to clipboard
[ChipGroup] Allow the option to set max rows of chips to display for a chip group
Partially solves https://github.com/material-components/material-components-android/issues/953
Add ChipGroup option to set maxRowCount
. If set, will display chips up to maxRowCount
.

Add ChipGroup option overflowChipEnabled
and overflowChipTextResource
. If enabled with maxRowCount
will display a chip using overflowChipTextResource
(can be a PluralRes or StringRes) to set the text to display when reflow exceeds maxRowCount
.

Added a new catalog for chipgroup showing example of usage.
The use case for enabling overflowChipEnabled
or even setting maxRowCount
works well for display of read only
(no interactions) chips. The implementation of this could include binding a onClick
event on the overflow chip to navigate to an edit/selection type page of chips
- [x] Identify the component the PR relates to in brackets in the title.
[Buttons] Updated documentation
- [x] Link to GitHub issues it solves.
Partially solves https://github.com/material-components/material-components-android/issues/953
- [x] Sign the CLA bot. You can do this once the pull request is opened.
It's great to see that you have a chip showing how many more chips are available, however, I think it would make sense if it was on the 2nd row instead of an additional row.
It's great to see that you have a chip showing how many more chips are available, however, I think it would make sense if it was on the 2nd row instead of an additional row.
I think having it on the 2nd or new row can depend on the design requirements. This possibly could be a choice as opposed to a rule ?
Could you please add an overflowChipSingularResource as well?
Could you please add an overflowChipSingularResource as well?
👍 . Is this so we can have view text that just displays more...
or the like ?
Could you please add an overflowChipSingularResource as well?
@wcshi updated so that the attribute overflowChipPluralResource
is now overflowChipTextResource
and can accept a PluralRes or StringRes
This is not a comprehensive set of comments, there are still problems, we are considering opening up the api so this could be an extension instead.
This is a starting point on what direction we want to take it.
As i see it, i don't see a usecase where we would want to limit the display rows and have any chips selectable when you don't show all the chips available. Hence ideally the only reason you would have a max row count is in a read only state. And the implementer can choose to decide how they want to proceed to a editable/selectable like display. This can be a new screen or the re-render of the chipgroup without a max row defined.
Will take your lead on this on how to proceed on this feature. Happy to help where i can.
Any chance this will be resolved and merged soon? Super excited for the option to set a max number of rows and have the ChipGroup know how to scroll from there. I'd like to display a bunch of actionable chips that a user can click, but want more than just one row of chips. I'd rather have a scrollable grid with a customizable number of rows of chips.
any progress on that?
any progress on that?
Hi all, sorry for such a delay on my side on responding to the interest of this feature. As it seems, there doesn't seem to be an appetite from their end to have this feature as a feature on the materials component. This has been open for a long time and not sure if google are willing to revisit. There is also what looks like similar issue/request https://github.com/material-components/material-components-android/issues/696 which has a long timeline.
I'm sad that Google does not merge this pr. Many times setting the max line is very useful. You did a good job! 👍