package com.jakewharton.u2020.ui.debug;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.jakewharton.u2020.ui.misc.BindableAdapter;

class EnumAdapter<T extends Enum<T>> extends BindableAdapter<T> {
  private final T[] enumConstants;
  private final boolean showNull;
  private final int nullOffset;

  EnumAdapter(Context context, Class<T> enumType) {
    this(context, enumType, false);
  }

  EnumAdapter(Context context, Class<T> enumType, boolean showNull) {
    super(context);
    this.enumConstants = enumType.getEnumConstants();
    this.showNull = showNull;
    this.nullOffset = showNull ? 1 : 0;
  }

  @Override public final int getCount() {
    return enumConstants.length + nullOffset;
  }

  @Override public final T getItem(int position) {
    if (showNull && position == 0) {
      return null;
    }

    return enumConstants[position - nullOffset];
  }

  @Override public final long getItemId(int position) {
    return position;
  }

  @Override public final View newView(LayoutInflater inflater, int position, ViewGroup container) {
    return inflater.inflate(android.R.layout.simple_spinner_item, container, false);
  }

  @Override public final void bindView(T item, int position, View view) {
    TextView tv = (TextView) view.findViewById(android.R.id.text1);
    tv.setText(getName(item));
  }

  @Override
  public final View newDropDownView(LayoutInflater inflater, int position, ViewGroup container) {
    return inflater.inflate(android.R.layout.simple_spinner_dropdown_item, container, false);
  }

  protected String getName(T item) {
    return String.valueOf(item);
  }
}

@@ -244,16 +244,48 @@
 Adapter;
+%0Aimport butterknife.ButterKnife;
 %0A%0Aclass 
@@ -1387,37 +1387,35 @@
 v = 
-(TextView) view
+ButterKnife
 .find
-View
 ById(
+view, 
 andr

Replace some more findViewById calls with ButterKnife