Skip to content

[MaterialDividerItemDecoration] The decorator in the last item with isLastItemDecorated false is blinking in a dropdown view showing and hiding the decorator very fast #2771

@mnlmato

Description

@mnlmato

int dividerCount = lastItemDecorated ? childCount : childCount - 1;

I used this divider in the last item with a dropdown. When the itemView is clicked then shows a textView from gone to visible state and it is working ok (the divider is not showed) but when the view collapses the textView (from visible to gone) then the childcount is increased one time and decreased very quick, showing and hiding the divider very fast.

Maybe using the itemCount from adapter and not the childCount could fix the problem. I tried this approach using a custom ItemDecorator overriding the onDrawOver and it is working, but i dont know if is the best solution.

Update: The blink appears when is called the method notifyItemChanged(pos, item)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions