package org.commcare.android.adapters;

import android.annotation.SuppressLint;
import android.os.Parcel;
import android.os.Parcelable;
import android.view.View;

/**
 * Created by jschweers on 9/2/2015.
 */
public class ListItemViewStriper implements ListItemViewModifier, Parcelable {
    private int mOddColor;
    private int mEvenColor;

    public ListItemViewStriper(int oddColor, int evenColor) {
        super();
        mOddColor = oddColor;
        mEvenColor = evenColor;
    }

    protected ListItemViewStriper(Parcel in) {
        mOddColor = in.readInt();
        mEvenColor = in.readInt();
    }

    public static final Creator<ListItemViewStriper> CREATOR = new Creator<ListItemViewStriper>() {
        @Override
        public ListItemViewStriper createFromParcel(Parcel in) {
            return new ListItemViewStriper(in);
        }

        @Override
        public ListItemViewStriper[] newArray(int size) {
            return new ListItemViewStriper[size];
        }
    };

    @Override
    public void modify(View view, int position) {
        if (position % 2 == 0) {
            view.setBackgroundColor(mEvenColor);
        } else {
            view.setBackgroundColor(mOddColor);
        }
    }

    @Override
    public int describeContents() {
        return mOddColor ^ mEvenColor;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        // do nothing
        dest.writeInt(mOddColor);
        dest.writeInt(mEvenColor);
    }
}

@@ -39,49 +39,8 @@
 %0D%0A%0D%0A
-import android.annotation.SuppressLint;%0D%0A
 impo
@@ -1403,31 +1403,8 @@
  %7B%0D%0A
-        // do nothing%0D%0A
     

Remove unused import / stale comment