BelooS / ChipsLayoutManager

ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
Apache License 2.0
3.25k stars 362 forks source link

Automatic increment in margin space #61

Closed ramseth001 closed 5 years ago

ramseth001 commented 5 years ago

When a new item is added, or an existing item is deleted, margin space is increasing automatically in all rows and columns. It should be happening only in the vicinity of an interacted item.

This is the setting I am using:

ChipsLayoutManager chipsLayoutManager = ChipsLayoutManager.newBuilder(this) .setChildGravity(Gravity.CENTER_VERTICAL) .setMaxViewsInRow(5) .setScrollingEnabled(true) .setOrientation(ChipsLayoutManager.HORIZONTAL) .setRowStrategy(ChipsLayoutManager.STRATEGY_DEFAULT) .withLastRow(true).build();

rvSubject.setLayoutManager(chipsLayoutManager); rvSubject.addItemDecoration(new SpacingItemDecoration(5, 5));

ramseth001 commented 5 years ago

Every time the page is launched, rvSubject.addItemDecoration() is adding new space to the existing one. With the help of boolean variable, I am executing that line only one.