package athary.audio.ency.Helpers.data;

import android.content.Context;
import android.database.Cursor;
import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.TextView;
import athary.audio.ency.IntroActivity;
import athary.audio.ency.R;

public class ClassAdapter extends CursorAdapter {

private LayoutInflater mInflater;
private int mClass_ID;

public ClassAdapter(Context context, Cursor c) {
super(context, c);

mClass_ID = c.getColumnIndex(NewDataDbAdapter.KEY_CATEGORY_NAME);

mInflater = LayoutInflater.from(context);
}

@Override
public void bindView(View view, Context context, Cursor cursor) {
TextView ind = (TextView) view.findViewById(R.id.ind);

ind.setTypeface(IntroActivity.tf,Typeface.NORMAL);
ind.setTextSize(TypedValue.COMPLEX_UNIT_SP, IntroActivity.fontsize);

ind.setText(cursor.getString(mClass_ID));

}

@Override
public View newView(Context context, Cursor cursor, ViewGroup parent) {
return mInflater.inflate(R.layout.txt_class, null);
}

}

