I'm trying to load a StorageReference
from Firebase Storage
. I'm using the Glide
library and the FirebaseImageLoader
class from the FirebaseUI
. The .using method fails to resolve. I think the problem is something to do with the context. homeTeam is my ImageView.
public class MatchAdapter extends FirestoreAdapter<MatchAdapter.ViewHolder> {
//......
static class ViewHolder extends RecyclerView.ViewHolder {
private Context mContext;
@BindView(R.id.imageView)
ImageView homeTeam;
@BindView(R.id.imageView2)
ImageView awayTeam;
@BindView(R.id.textView)
TextView score;
@BindView(R.id.textView2)
TextView competition;
@BindView(R.id.textView3)
TextView game;
public ViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
}
public void bind(final DocumentSnapshot snapshot,
final OnMatchSelectedListener listener) {
Match match = snapshot.toObject(Match.class);
Resources resources = itemView.getResources();
Glide.with(mContext)
.using(new FirebaseImageLoader())
.load(match.getHomeTeam())
.into(homeTeam);
Glide.with(awayTeam.getContext())
.load(match.getAwayTeam())
.into(awayTeam);
score.setText(match.getScore());
competition.setText(match.getCompetition());
game.setText(match.getGame());
// Click listener
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (listener != null) {
listener.onMatchSelected(snapshot);
}
}
});
}
}
// ...
}