I've tried everything that I could find on stackoverflow but nothing seems to work.
The problem is that I cant change the font of any TextView inside my CardViewLayout.
I've tried font family, text appearance in xml I've changed it by doing this, but I'm getting the error Cannot resolve symbol 'itemView'
code:
public class cardAdapter extends ArrayAdapter<cardModel> {
public cardAdapter(Context context) {
super(context, 0);
}
@Override
public View getView(int position, View contentView, ViewGroup parent) {
ViewHolder holder;
if (contentView == null) {
LayoutInflater inflater = LayoutInflater.from(getContext());
contentView = inflater.inflate(R.layout.card_layout, parent, false);
holder = new ViewHolder(contentView);
contentView.setTag(holder);
} else {
holder = (ViewHolder) contentView.getTag();
}
cardModel spot = getItem(position);
holder.title.setText(spot.title);
holder.description.setText(spot.description);
Glide.with(getContext()).load(spot.url).into(holder.image);
return contentView;
}
private static class ViewHolder {
public TextView title;
public TextView description;
public ImageView image;
Typeface customTypeOne = Typeface.createFromAsset(itemView.getContext().getAssets(), "fonts/typefaceone.ttf");
public ViewHolder(View view) {
this.title = (TextView) view.findViewById(R.id.title);
title.setTypeface(customTypeOne);
this.description = (TextView) view.findViewById(R.id.description);
this.image = (ImageView) view.findViewById(R.id.image);
}
}
}