How to add progress bar to Picasso library

前端 未结 3 1090
梦谈多话
梦谈多话 2021-01-03 09:48

How can you add a progress bar to Picasso library with this code for downloading photos

String Url = \"link url\";
Picasso.with(G.currentActivity).load(Url).         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-03 10:07

    There is currently no progress callback in the Picasso library.

    According to the author Jake Wharton, this is not likely to be implemented into the library in future and is not easy to implement. According to the feature request:

    [Progress Callbacks] would require complicated machinery for very little gain. We recommend that you use an indeterminate progress indicator since the image download should be relatively quick.

    I would suggest following the advice of using an indeterminate progress indicator - should your images take a while to download, you may want to investigate if you are either doing too much work on the UI thread before the images are loaded or if the images you are loading are a large file size.

提交回复
热议问题