package com.hikapro.backpack.view.recycler;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.hikapro.backpack.R;
import com.hikapro.backpack.presenter.adapters.helper.sets.ItemTouchHelperViewHolder;

/**
 * Created by tariel on 20/04/16.
 */
public class SetViewHolder extends RecyclerView.ViewHolder implements ItemTouchHelperViewHolder{

    public CardView cardView;
    public TextView textView;
    public TextView setInfo;

    //GLM_add_resources_SetList
    private View view;
    private Drawable drawable;

    public SetViewHolder(View v) {
        super(v);
        setupViews(v);
    }

    private void setupViews(View view) {
        cardView    = (CardView) view.findViewById(R.id.card_view_set);
        textView    = (TextView) view.findViewById(R.id.set_text);
        setInfo     = (TextView) view.findViewById(R.id.set_info);

        this.view = view;
        drawable = view.getBackground();
    }

    //GLM_add_resources_SetList
    @Override
    public void onItemClear() {
        view.setBackground(drawable);
    }

    //GLM_add_resources_SetList
    @Override
    public void onItemSelected() {
        view.setBackgroundColor(Color.GRAY);
    }
}
