package trikita.anvil.gridlayout.v7;

import android.support.v7.widget.GridLayout;
import android.util.Printer;
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 generateGridLayoutv7DSL}.
 * It contains views and their setters from the library gridlayout-v7.
 * Please, don't edit it manually unless for debugging.
 */
public final class GridLayoutv7DSL implements Anvil.AttributeSetter {
  static {
    Anvil.registerAttributeSetter(new GridLayoutv7DSL());
  }

  public static BaseDSL.ViewClassResult gridLayout() {
    return BaseDSL.v(GridLayout.class);
  }

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

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

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

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

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

  public static Void printer(Printer arg) {
    return BaseDSL.attr("printer", arg);
  }

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

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

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

  public boolean set(View v, String name, final Object arg, final Object old) {
    switch (name) {
      case "alignmentMode":
        if (v instanceof GridLayout && arg instanceof Integer) {
          ((GridLayout) v).setAlignmentMode((int) arg);
          return true;
        }
        break;
      case "columnCount":
        if (v instanceof GridLayout && arg instanceof Integer) {
          ((GridLayout) v).setColumnCount((int) arg);
          return true;
        }
        break;
      case "columnOrderPreserved":
        if (v instanceof GridLayout && arg instanceof Boolean) {
          ((GridLayout) v).setColumnOrderPreserved((boolean) arg);
          return true;
        }
        break;
      case "orientation":
        if (v instanceof GridLayout && arg instanceof Integer) {
          ((GridLayout) v).setOrientation((int) arg);
          return true;
        }
        break;
      case "printer":
        if (v instanceof GridLayout && arg instanceof Printer) {
          ((GridLayout) v).setPrinter((Printer) arg);
          return true;
        }
        break;
      case "rowCount":
        if (v instanceof GridLayout && arg instanceof Integer) {
          ((GridLayout) v).setRowCount((int) arg);
          return true;
        }
        break;
      case "rowOrderPreserved":
        if (v instanceof GridLayout && arg instanceof Boolean) {
          ((GridLayout) v).setRowOrderPreserved((boolean) arg);
          return true;
        }
        break;
      case "useDefaultMargins":
        if (v instanceof GridLayout && arg instanceof Boolean) {
          ((GridLayout) v).setUseDefaultMargins((boolean) arg);
          return true;
        }
        break;
    }
    return false;
  }
}
