picasso

How to make Picasso/Glide work with Html.ImageGetter for caching images?

懵懂的女人 提交于 2019-12-06 00:30:35
Thanks for all the effort @Budius has made. Most part of image work of my app could be handled by Picasso/Glide, however, some images are displayed in a TextView by Html.fromHtml . And the images in TextView are also used frequently. However, I don't know how to implement getDrawable() method with Picasso/Glide for the ImageGetter passed to Html.fromHtml . Is it possible to share the same cache of Picasso/Glide for these pictures in TextView and other bitmaps? Or should I use an custom LruCache instead to cache these pictures form ImageGetter separately? Will this way increase the risk of an

How to make glide display like picasso?

a 夏天 提交于 2019-12-05 22:02:14
I've been using Picasso's library to load images into my gridview in my application and it works and looks exactly as I'd like. But users are telling me that the images are loading very slowly. I know that this is because of poor network speed and Picasso is loading my full images which are very big and then resizing them to fit my image view. So I tried using glide which loads the images in almost twice the speed but on some images it's not keeping the structure like Picasso does. For example Picasso loading images looks like Whilst glide loading them has different states here's what it loads

Android picasso check if image url exist before load into imageView [duplicate]

送分小仙女□ 提交于 2019-12-05 20:53:47
This question already has answers here : how to make picasso display default image when there is an invalid path (3 answers) How can I use a Color as placeholder image with Picasso? (3 answers) Closed last year . I'm currently working on RecyclerView with data binding implement, to load Image from a list of url (/images/slider/my/myImage.jpg) get from API. @BindingAdapter("imageUrl") public static void loadImage(ImageView imageView, String imageUrl){ Picasso.with(imageView.getContext()).load(CommUtils.WEBSITE_LINK + imageUrl).into(imageView); } Currently i have the code above in my ListAdapter

Cancelling the Image Request Android on the basis of progress - Image loader Volley , Picasso

痞子三分冷 提交于 2019-12-05 20:35:34
There are many popular Image loader available in Github for image loading and caching and Managing Image Request. Universal Image Loader Volley Picasso Fresco (added enhancement ) I came across the requirement if the Imageview if no longer attached to window the request (batch and flight ) will be cancelled . However the scrolling widget like Listview and Gridview the Imageview is frequently attached and detached from window and so the request in queue are canceled respectively . My concern is that their no mechanism to trace the progress of image request in all above library .If Imageview is

Picasso doesn't cache image on disk

时间秒杀一切 提交于 2019-12-05 20:22:01
I have to use custom OkHttpClient so I can add headers to the image requests. The problem is Picasso won't cache any images on disk because of this. I've used setIndicatorsEnabled(true) to check caching and I see only red indicators. When I use default OkHttpDownloader all is ok. Below is my Picasso initialization code. So does anyone encounter the same problem? public static void init(Context context) { Picasso.Builder builder = new Picasso.Builder(context); OkHttpClient client = new OkHttpClient(); client.interceptors().add(new AuthInterceptor()); Downloader downloader = new OkHttpDownloader

Picasso not working if url contains space

只谈情不闲聊 提交于 2019-12-05 17:37:27
I am developing an Android app in which I am retrieving an image from a server and show it in an image view using Picasso. Some image URLs don't work even though I can test them successfully in a browser. For example this URL works correctly: http://www.tonightfootballreport.com/\Filebucket\Picture\image\png\20160730011032_BPL.png But this one fails: http://www.tonightfootballreport.com/\Filebucket\Picture\image\png\20160807025619_Serie A.png The difference appears to be that the failing URL contains a space. What do I need to do to make this work? String temp = "http://www

Force re-downloading image with Picasso

冷暖自知 提交于 2019-12-05 12:30:15
I'm creating an application which is going to download image from specific url and display it on ImageView. Server changes this image over time, but url stays the same. So I want to implement such logic: When app is rotated or reopened, load image from apps cache When user clicks the download button, image should be re-downloaded from the network and replace the cache How do I implement such approach with Picasso? Or maybe some other library would fit it better? Picasso.with(context) .load(url) .memoryPolicy(MemoryPolicy.NO_CACHE) .networkPolicy(NetworkPolicy.NO_CACHE) .fit() .centerCrop()

Picasso disk caching

强颜欢笑 提交于 2019-12-05 10:15:32
I am using Picasso to load images from a URL Picasso.with(getApplicationContext()).load(product.getImageUrl()).into(imageView); From what I can see this is going to the url everytime and not caching to disk. I need disk caching enabled I have permissions <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> So its not a issue with disk. I think the issue is that the server is not sending back a cache param so HTTP Client is not caching. How can I force Picasso use the disk cache at all times? Picasso doesn't

Picasso onBitmapLoaded never called

喜你入骨 提交于 2019-12-05 09:07:51
I am having the same problem, that I want to use the drawables that are generated by the Picasso for Image Caching Purpose, but I am not able to get the same. Here is the code which I am using to access the Bitmap Drawables : Target targetBitmap = new Target() { @Override public void onPrepareLoad(Drawable arg0) { } @Override public void onBitmapLoaded(Bitmap arg0, Picasso.LoadedFrom arg1) { mBitmap = arg0; BitmapDrawable d = new BitmapDrawable(context.getResources(), arg0); int margin = 2; int border = 0; Rect r = new Rect(margin, margin, width - margin, height - margin); int imageWidth = r

How can I use a Color as placeholder image with Picasso?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 08:17:39
I want to use Picasso to set a Color as placeholder image. I tried this: int placeHolderColor2 = Color.rgb(20,20,20); Picasso.with(context) .load(item.getImageUrls().get(0)) .placeholder(placeHolderColor2) .error(R.drawable.card_image) .centerCrop() .fit() .into(viewHolder.imageView); But it leads to the following error: 10-07 05:36:42.965 5827-5827/? E/AndroidRuntime: android.content.res.Resources$NotFoundException: Resource ID #0xff141414 10-07 05:36:42.965 5827-5827/? E/AndroidRuntime: at android.content.res.Resources.getValue(Resources.java:1266) 10-07 05:36:42.965 5827-5827/? E