ChipsLayoutManager icon indicating copy to clipboard operation
ChipsLayoutManager copied to clipboard

How to use same spacing for auto-spacing between views and on sides?

Open AndroidDeveloperLB opened this issue 8 years ago • 0 comments

Is it possible to set the spacing between the items (and on the edges), so that it will be even? Something like the weight used on LinearLayout? Is it STRATEGY_FILL_SPACE or STRATEGY_FILL_VIEW?

I tried to use :

    ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(getActivity())
            .setChildGravity(Gravity.CENTER)
            .setScrollingEnabled(true)
            .setRowStrategy(ChipsLayoutManager.STRATEGY_FILL_SPACE).withLastRow(true)
            .setMaxViewsInRow(3)
            .build();

But it doesn't put space at the edges of the items, only between them:

image

Using STRATEGY_FILL_VIEW, it's almost what I wrote, but it puts half of the space at the edges:

image

AndroidDeveloperLB avatar May 15 '17 07:05 AndroidDeveloperLB