I have saved images in Firestore in form of an ArrayList of type String which has its URL. I want to get those images stored in a field "images" into an imageslider that has Slidemodel that takes ArrayList as a parameter.
The class slideModel has the following variables:
private String imageUrl;
private Integer imagePath;
private ScaleTypes scaleTypes;
private String title;
The code pasted below is iterating over documents not the fields of a particular document
db.collection("userimages").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
for (QueryDocumentSnapshot document : task.getResult())
sliderDataArrayList.add(new SlideModel(document.getData().toString(), ScaleTypes.FIT));
imageSlider.setImageList(sliderDataArrayList,ScaleTypes.FIT);
}
}
The image slider takes ArrayList as a parameter and a Scale Type.
This code in the image slider is getting the documents into the slider not the field of that document that contains the images.Image of how the data is structured in firestore
I want to get the "field": "images" which has the ArrayList of strings containing image URLs and then store it in the sliderDataArrayList .
final List<SlideModel> sliderDataArrayList = new ArrayList<>();
PLEASE SUGGEST TO ME A BETTER WAY TO GET AROUND IT OR AN ANSWER TO THIS PROBLEM THANK YOU!