• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Setting Layout INVISIBLE until Glide finished loading images from server

 
Ranch Hand
Posts: 35
Android Java ME
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello i asked the same question few days ago on StackOverflow but no answer...and i kinda  need an answer

The problem is that Glide .listener() is triggered image by image, so when i tried to set my fragment layout invisible until all images are loaded, it set's fragment layout visibility to visible after first image is loaded and  ignores the fact that rest of images are still not loaded into imageview.
Glide checks with it's listener images by images and after first one is ready it set's my visibility t visible and i do not want this..i want to my fragment layout be invisible until all images are ready to display. Now i will basically past my SstockOverflow post here.

i have a fragment with several recycleviews that contain some text and image from users. Problem is that my images are loaded a second or less after my layout is inflated. I can't use any placeholder for that time or something else.
My instructions are that my layout must be shown only when all data and images are ready from all recyclerviews, and be shown in the same time. I am using glide .listener() method.
I tried: 1)to set boolean value in .listener() and save it in SharedPref and load it in my fragment where my recycleviews are and if Boolean value is the same then set visibility of fragment to visible ,which previously was set to invisible
2) to do the same thing just with custom callbacks
3)and this solution that i am going to past here. Basically i am passing my layout to adapter with constructor and setting it invisible in .listener().



my glide in adapter:

and my adapter:
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic