Code for filtering in ArrayAdapter
Use final properties


private List&lt;String&gt; list = null;
private ArrayList&lt;String&gt; arrayList;



Both properties are set in the constructor, so they should both be final.

private final List&lt;String&gt; list = new ArrayList&lt;&gt;();
private final ArrayList&lt;String&gt; arrayList = new ArrayList&lt;&gt;();

public AlternateRowArrayAdapter(@NonNull Context context, @LayoutRes int layout,
                                @IdRes int textViewResourceId, @NonNull List&lt;String&gt; objects)
{
   // ...
    this.list.addAll(objects); // same solution for both lists!
    this.arrayList.addAll(this.list);
}




Choose better names

Naming is the hardest part in programming. Always take your time to think about the names of your identifiers, if they express their purpose.

E.G.: Your lists should have better names like allItems and filteredItems

Work in constructors

In general constructors should not access any method on a dependency or and non private or non final method inside its own class (except super() and this()). 

Therefore I'd rather pass in the colors array as constructor parameter. But I don't know much about android programming to say if that is even possible... 


  Regarding using colors in constructors - it's possible to pass them as an arguement, but we already pass a context as an argument which contains these colors – Marek Czaplicki


Because you passed the context instead of the color array you class has two more dependencies: the context itself and the ResourcesCompat class. You class should have as less dependencies as possible.