You need to change the color of the entire RecyclerView element. It only happened to me as in the screenshot, but it is necessary that what is painted white be the same color (brown).

I painted through android: background.
colorBackground and windowBackground do not paint at all.

Tell me how to solve the problem.

Screenshot:

alt text

    1 answer 1

    Everything is simple.

    You need in the onBindViewHolder () method of the adapter to get a reference to the ViewGroup of the list item. And assign it a background color. The link can be obtained by the getParent () method of the View class.

    That is, suppose you have only one child in the holder, which you called the text to the class of the holder. Then the whole element can be obtained as follows:

    ViewGroup vg = (ViewGroup) yoursHolder.text.getParent(); vg.setBackgroundColor(act.getResources().getColor(R.color.blue));