public ArrayList<DataHolder> readGallery(final GalleryActivity activity){
  ArrayList<DataHolder> listOfAllImages=new ArrayList<>();
  prepareDataForReading();
  if (activity.getType() == Const.GalleryType.IMAGE || activity.getType() == Const.GalleryType.IMAGE_VIDEO) {
    listOfAllImages.addAll(getImages());
  }
  if (activity.getType() == Const.GalleryType.VIDEO || activity.getType() == Const.GalleryType.IMAGE_VIDEO) {
    listOfAllImages.addAll(getVideos());
  }
  Collections.sort(listOfAllImages,new DataHolderComparator());
  return listOfAllImages;
}

public ArrayList < DataHolder > readGallery ( final GalleryActivity activity ) { ArrayList < DataHolder > listOfAllImages = new ArrayList < > ( ) ; prepareDataForReading ( ) ; if ( activity . getType ( ) == Const . GalleryType . IMAGE || activity . getType ( ) == Const . GalleryType . IMAGE_VIDEO ) { listOfAllImages . addAll ( getImages ( ) ) ; } if ( activity . getType ( ) == Const . GalleryType . VIDEO || activity . getType ( ) == Const . GalleryType . IMAGE_VIDEO ) { listOfAllImages . addAll ( getVideos ( ) ) ; } Collections . sort ( listOfAllImages , new DataHolderComparator ( ) ) ; return listOfAllImages ; }
function for reading gallery
