I\'m using FirebaseRecyclerAdapter
to populate a RecyclerView
in a Fragment
.
Here\'s my code
mDatabase = Firebase
In your activity.xml file, set ProgressBar property
android:visibility="invisible"
and in your populateViewHolder method, set mProgress.setVisibility(View.GONE);
after setting data to TextViews & ImageView
protected void populateViewHolder(ProductViewHolder viewHolder, Product model, int position) {
viewHolder.name.setText(model.name);
viewHolder.price.setText(model.price);
Glide.with(getActivity()).load(model.imageUri).into(viewHolder.thumbnail);
mProgress.setVisibility(View.GONE);
Log.d("NAME", model.name);
}
Remove the recyclerView.setHasFixedSize(true)
from your code and then check if the code works fine now.
And for dismissing the ProgressBar
, its good to set the visibility to GONE
.
mProgressBar.setVisibility(View.GONE);
For more information you can see this Github link. I think the same issue is reported here.