package cc.rainwave.android.adapters;

import cc.rainwave.android.R;
import cc.rainwave.android.api.types.Album;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;

public class AlbumListAdapter extends ArrayAdapter<Album> {

    public AlbumListAdapter(Context context, int resource, Album[] objects) {
        super(context, resource, objects);
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        View v = super.getView(position, convertView, parent);
        Album a = getItem(position);
        if(a.isCooling()) {
            v.setBackgroundResource(R.drawable.gradient_cooldown);
        }
        else {
            v.setBackgroundResource(0);
        }
        return v;
    }
}

@@ -36,82 +36,8 @@
 s;%0A%0A
-import cc.rainwave.android.R;%0Aimport cc.rainwave.android.api.types.Album;%0A
 impo
@@ -132,35 +132,73 @@
 ort 
-android.widget.ArrayAdapter
+cc.rainwave.android.R;%0Aimport cc.rainwave.android.api.types.Album
 ;%0A%0Ap
@@ -238,13 +238,18 @@
 nds 
-Array
+Filterable
 Adap

make AlbumListAdapter inherit from FilterableAdapter