package trikita.anvil.recyclerview.v7;

import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerViewAccessibilityDelegate;
import android.view.View;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.Object;
import java.lang.String;
import java.lang.Void;
import trikita.anvil.Anvil;
import trikita.anvil.BaseDSL;

/**
 * DSL for creating views and settings their attributes.
 * This file has been generated by {@code gradle generateRecyclerViewv7DSL}.
 * It contains views and their setters from the library recyclerview-v7.
 * Please, don't edit it manually unless for debugging.
 */
public final class RecyclerViewv7DSL extends BaseRecyclerView implements Anvil.AttributeSetter {
  static {
    Anvil.registerAttributeSetter(new RecyclerViewv7DSL());
  }

  public static BaseDSL.ViewClassResult recyclerView() {
    return BaseDSL.v(RecyclerView.class);
  }

  public static Void recyclerView(Anvil.Renderable r) {
    return BaseDSL.v(RecyclerView.class, r);
  }

  public static Void accessibilityDelegateCompat(RecyclerViewAccessibilityDelegate arg) {
    return BaseDSL.attr("accessibilityDelegateCompat", arg);
  }

  public static Void adapter(RecyclerView.Adapter arg) {
    return BaseDSL.attr("adapter", arg);
  }

  public static Void childDrawingOrderCallback(RecyclerView.ChildDrawingOrderCallback arg) {
    return BaseDSL.attr("childDrawingOrderCallback", arg);
  }

  public static Void edgeEffectFactory(RecyclerView.EdgeEffectFactory arg) {
    return BaseDSL.attr("edgeEffectFactory", arg);
  }

  public static Void hasFixedSize(boolean arg) {
    return BaseDSL.attr("hasFixedSize", arg);
  }

  public static Void itemAnimator(RecyclerView.ItemAnimator arg) {
    return BaseDSL.attr("itemAnimator", arg);
  }

  public static Void itemViewCacheSize(int arg) {
    return BaseDSL.attr("itemViewCacheSize", arg);
  }

  public static Void layoutFrozen(boolean arg) {
    return BaseDSL.attr("layoutFrozen", arg);
  }

  public static Void layoutManager(RecyclerView.LayoutManager arg) {
    return BaseDSL.attr("layoutManager", arg);
  }

  public static Void onFling(RecyclerView.OnFlingListener arg) {
    return BaseDSL.attr("onFling", arg);
  }

  public static Void preserveFocusAfterLayout(boolean arg) {
    return BaseDSL.attr("preserveFocusAfterLayout", arg);
  }

  public static Void recycledViewPool(RecyclerView.RecycledViewPool arg) {
    return BaseDSL.attr("recycledViewPool", arg);
  }

  public static Void recyclerListener(RecyclerView.RecyclerListener arg) {
    return BaseDSL.attr("recyclerListener", arg);
  }

  public static Void scrollingTouchSlop(int arg) {
    return BaseDSL.attr("scrollingTouchSlop", arg);
  }

  public static Void viewCacheExtension(RecyclerView.ViewCacheExtension arg) {
    return BaseDSL.attr("viewCacheExtension", arg);
  }

  public boolean set(View v, String name, final Object arg, final Object old) {
    switch (name) {
      case "accessibilityDelegateCompat":
        if (v instanceof RecyclerView && arg instanceof RecyclerViewAccessibilityDelegate) {
          ((RecyclerView) v).setAccessibilityDelegateCompat((RecyclerViewAccessibilityDelegate) arg);
          return true;
        }
        break;
      case "adapter":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.Adapter) {
          ((RecyclerView) v).setAdapter((RecyclerView.Adapter) arg);
          return true;
        }
        break;
      case "childDrawingOrderCallback":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.ChildDrawingOrderCallback) {
          ((RecyclerView) v).setChildDrawingOrderCallback((RecyclerView.ChildDrawingOrderCallback) arg);
          return true;
        }
        break;
      case "edgeEffectFactory":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.EdgeEffectFactory) {
          ((RecyclerView) v).setEdgeEffectFactory((RecyclerView.EdgeEffectFactory) arg);
          return true;
        }
        break;
      case "hasFixedSize":
        if (v instanceof RecyclerView && arg instanceof Boolean) {
          ((RecyclerView) v).setHasFixedSize((boolean) arg);
          return true;
        }
        break;
      case "itemAnimator":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.ItemAnimator) {
          ((RecyclerView) v).setItemAnimator((RecyclerView.ItemAnimator) arg);
          return true;
        }
        break;
      case "itemViewCacheSize":
        if (v instanceof RecyclerView && arg instanceof Integer) {
          ((RecyclerView) v).setItemViewCacheSize((int) arg);
          return true;
        }
        break;
      case "layoutFrozen":
        if (v instanceof RecyclerView && arg instanceof Boolean) {
          ((RecyclerView) v).setLayoutFrozen((boolean) arg);
          return true;
        }
        break;
      case "layoutManager":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.LayoutManager) {
          ((RecyclerView) v).setLayoutManager((RecyclerView.LayoutManager) arg);
          return true;
        }
        break;
      case "onFling":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.OnFlingListener) {
          if (arg != null) {
            ((RecyclerView) v).setOnFlingListener(new RecyclerView.OnFlingListener() {
              public boolean onFling(int a0, int a1) {
                boolean r = ((RecyclerView.OnFlingListener) arg).onFling(a0, a1);
                Anvil.render();
                return r;
              }
            });
          } else {
            ((RecyclerView) v).setOnFlingListener((RecyclerView.OnFlingListener) null);
          }
          return true;
        }
        break;
      case "preserveFocusAfterLayout":
        if (v instanceof RecyclerView && arg instanceof Boolean) {
          ((RecyclerView) v).setPreserveFocusAfterLayout((boolean) arg);
          return true;
        }
        break;
      case "recycledViewPool":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.RecycledViewPool) {
          ((RecyclerView) v).setRecycledViewPool((RecyclerView.RecycledViewPool) arg);
          return true;
        }
        break;
      case "recyclerListener":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.RecyclerListener) {
          ((RecyclerView) v).setRecyclerListener((RecyclerView.RecyclerListener) arg);
          return true;
        }
        break;
      case "scrollingTouchSlop":
        if (v instanceof RecyclerView && arg instanceof Integer) {
          ((RecyclerView) v).setScrollingTouchSlop((int) arg);
          return true;
        }
        break;
      case "viewCacheExtension":
        if (v instanceof RecyclerView && arg instanceof RecyclerView.ViewCacheExtension) {
          ((RecyclerView) v).setViewCacheExtension((RecyclerView.ViewCacheExtension) arg);
          return true;
        }
        break;
    }
    return false;
  }
}
