package com.prateekj.snooper.infra;

import android.databinding.BindingAdapter;
import android.support.v7.widget.RecyclerView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class CustomBindings {

  @BindingAdapter("app:adapter")
  public static void setAdapter(RecyclerView recyclerView, RecyclerView.Adapter adapter) {
    recyclerView.setAdapter(adapter);
  }

  @BindingAdapter("app:listAdapter")
  public static void setListAdapter(ListView listView, BaseAdapter adapter) {
    listView.setAdapter(adapter);
  }

  @BindingAdapter("app:itemDecoration")
  public static void setItemDecoration(RecyclerView recyclerView, RecyclerView.ItemDecoration itemDecoration) {
    recyclerView.addItemDecoration(itemDecoration);
  }

  @BindingAdapter({"textColor"})
  public static void setTextColor(TextView view, int color) {
    if (color != 0) {
      view.setTextColor(view.getResources().getColor(color));
    }
  }

}

@@ -270,20 +270,16 @@
 dapter(%22
-app:
 adapter%22
@@ -433,20 +433,16 @@
 dapter(%22
-app:
 listAdap
@@ -587,12 +587,8 @@
 er(%22
-app:
 item

Revert "Revert "removing data binding warnings""