can anyone explain the difference between DividerItemDecoration and LinearLayoutManager?
when should i use DividerItemDecoration and when should i use LinearLayoutManager in recycler view?
can anyone explain the difference between DividerItemDecoration and LinearLayoutManager?
when should i use DividerItemDecoration and when should i use LinearLayoutManager in recycler view?
LinearLayoutManager and DividerItemDecoration has entirely different use cases.
When you use a RecyclerView, you need to specify a LayoutManager that is responsible for laying out each item in the view. The LinearLayoutManager is a type of LayoutManager which allows you to specify an orientation, just like a normal LinearLayout would.
DividerItemDecoration is a RecyclerView.ItemDecoration that can be used as a divider between items of a LinearLayoutManager. For providing spaces or divider between your RecyclerView item you can use DividerItemDecoration.