in Education by
I have started implementation of Glide in my existing project and have been going through docs and examples. I checked sample app of Flickr and am trying to preload images just like it. I am initialising GlideRequest in fragment and then passing it to the adapter to preload images and display. But when I run my app, I am neither getting any error nor are any images displayed. I have slightly modified my code from sample app as I don't want any model loader. This is my initialisation in fragment: private GlideRequests instructorRequestBuilder; instructorRequestBuilder = GlideApp.with(this); I assign in it to preloadRequest Variable in adapter's constructor. Then following is the code into bindViewHolder: private void setImage(final String image, final ImageView imageView) { preloadRequest.load(image) .centerCrop() .placeholder(R.drawable.placeholder_explore_user) .error(R.mipmap.ic_launcher) .listener(new RequestListener() { @Override public boolean onLoadFailed(@Nullable GlideException e, Object model, Target target, boolean isFirstResource) { Log.d(TAG, "onLoadFailed: " + e); return false; } @Override public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { Log.d(TAG, "onLoadFailed: " + isFirstResource); Log.d(TAG, "onLoadFailed: " + dataSource); return false; } }) .into(imageView); } My adapter implements ListPreloader.PreloadModelProvider And this is the code for implemented methods: @NonNull @Override public List getPreloadItems(int position) { return iConnectInstructors.subList(position, position + 1); } @Nullable @Override public RequestBuilder getPreloadRequestBuilder(@NonNull IConnectType item) { return preloadRequest.load(((User) item) .getProfileImage250()) .placeholder(R.drawable.placeholder_explore_user) .centerCrop() .error(R.mipmap.ic_launcher); } PreloadSize and PreLoader are initialised as below: ViewPreloadSizeProvider preloadSizeProvider = new ViewPreloadSizeProvider<>(); RecyclerViewPreloader preloader = new RecyclerViewPreloader( GlideApp.with(this), adapter, preloadSizeProvider, 6); rvInstructor.addOnScrollListener(preloader); rvInstructor.setItemViewCacheSize(0); Why is this not showing any items in the recyclerview? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
It was an issue with the image size specified in viewholder. View holder was specified width and height of match_parent due to which image was not getting loaded. Even request listeners were failing, then I tried with submit()(as suggested here) and then realized that resources were loaded but loading them in view was failing.

Related questions

0 votes
    How do we create and preload an image object in JavaScript? (a) Use new keyword (b) Call Image() ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What do you understand by a glide record?...
asked May 25, 2021 in Technology by JackTerrance
0 votes
    I've made a fresh eclipse reinstall + Android SDK v4.0. I am trying to create a new 4.0 AVD ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 30, 2022 in Education by JackTerrance
0 votes
    I'm used to v3 node botbuilder sdk so I have a middleware where I look at the dialog stack and ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I want to connect android to my nao , it is version V4 or 1.14.5 and I do not find library ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 22, 2022 in Education by JackTerrance
0 votes
    I was coping with many problems to get stuck with this one. I have installed yum repository on server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Here some snippet of my code. when first time RecyclerView create I have to used recyclerView.scrollToPosition( ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I am newbie to android development and learning it to my own. I have a very strange problem of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I am newbie to android development and learning it to my own. I have a very strange problem of ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I want to expand/collapse the items of my recyclerView in order to show more info. I want to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a Fragment inside of my MainActivity that contains a RecyclerView being populated by a RecyclerView.Adapter ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 14, 2022 in Education by JackTerrance
0 votes
    I'm trying to recreate the same view as the Carrot Weather Layout modifier, that is a carousel on ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    I'm trying to recreate the same view as the Carrot Weather Layout modifier, that is a carousel on ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    _______ grammar makes a clear distinction between your data and what gets displayed on the screen or page. (a) ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    Choose the correct option: 1. Title of the project is displayed at Menu Bar/Title Bar. 2. Datatype which ... controlis Event/Property. Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
...