Monday, 1 July 2019

Glide image not loading in React Native native UI Component

I am creating a React Native native UI Component. It is an image gallery that requires loading images from URL. In my PageAdapter, I am loading the image using the following code but the image is not loading.

    Glide.with(context).load(url).listener(new RequestListener<Drawable>() {
        @Override
        public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
            Log.e("ImageLoader", "Load failed", e);
            return false;
        }

        @Override
        public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
            Log.i("ImageLoader", "Successfully loaded");
            return false;
        }
    }).override(720, 1280).into(imageView);

The onResourceReady method is always hitting but no image is loading. How do I solve this?



from Glide image not loading in React Native native UI Component

No comments:

Post a Comment