ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
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.
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.
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));