picasso

Animated loading image in picasso

筅森魡賤 提交于 2019-11-26 10:08:28
问题 I have the following code to load an image in Picasso, using a drawable for the placeholder to display while the image is downloading. What I want though is an animated spinning progress bar style spinner that animates around and around while the image is loading, like I see in most professional apps. Picasso doesn\'t seem to support this, only static image drawables. Is there a way to get it working with Picasso or do I have to do something different? Picasso.with(context).load(url)

Android: Picasso load image failed . how to show error message

风流意气都作罢 提交于 2019-11-26 09:28:34
问题 I am trying to use the picasso library to loading the image store in the mediastore. When I called load(imageview, callback), the picasso call onFail instead of onSuccess. How do I know why the image was not loaded successfully? 回答1: Use builder: Picasso.Builder builder = new Picasso.Builder(this); builder.listener(new Picasso.Listener() { @Override public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) { exception.printStackTrace(); } }); builder.build().load(URL).into

Load large images with Picasso and custom Transform object

拥有回忆 提交于 2019-11-26 09:08:21
问题 I\'m getting an Out Of Memory exception using Picasso when loading \"large\" images (> 1.5MB) from Android Gallery (using startActivityForResult). I\'m using a custom Target object because I need to preprocess the Bitmap when it is ready and also I\'m using a custom Transform object to scale the Bitmap. The problem is that the method public Bitmap transform(Bitmap source) on my Transform object is never called because the Out Of Memory Exception, so I don\'t get the oportunity to resample the

Resize image to full width and variable height with Picasso

百般思念 提交于 2019-11-26 08:47:53
问题 I have a listView with an adapter that contains ImageView of variable size (width and height). I need resize the pictures load with Picasso to the max width of layout and a variable height given by the aspect ratio of the picture. I have checked this question: Resize image to full width and fixed height with Picasso The fit() works but I haven\'t found nothing to keep the aspect ratio of the picture. This code partially works if I fixed the height in the layout of the adapter: Picasso.with

Picasso IllegalArgumentException Target must not be null

China☆狼群 提交于 2019-11-26 08:35:12
问题 I\'m trying to set image by using Picasso library on my project. When I click image of the View,I\'m getting an error on Picasso execution. Logcat of the app java.lang.IllegalArgumentException: Target must not be null. at com.squareup.picasso.RequestCreator.into(RequestCreator.java:340) at com.squareup.picasso.RequestCreator.into(RequestCreator.java:326) at com.zafer.celaloglu.FragmentsandActivities.UnfoldableDetailsFragment.openDetails(UnfoldableDetailsFragment.java:89) at com.zafer

Android Picasso library, How to add authentication headers?

瘦欲@ 提交于 2019-11-26 08:14:38
问题 I have tried setting a custom OkHttpClient with a custom Authenticator, however as the doc says: \"Responds to authentication challenges from the remote web or proxy server.\" I have to make 2 requests for each image, and that is not ideal. Is there a request interceptor like Retrofit does? Or am I missing something in the OkHttpClient? I\'m using the latest versions: compile \'com.squareup.picasso:picasso:2.3.2\' compile \'com.squareup.okhttp:okhttp:2.0.+\' compile \'com.squareup.okhttp

Using Picasso with custom disk cache

ぐ巨炮叔叔 提交于 2019-11-26 04:45:57
问题 In Volley library, the NetworkImageView class requires an ImageLoader that handles all the image requests by searching for them inside an ImageCache implementation, the user is free to choose how the cache should work, the location and the name of the images. I\'m switching from Volley to Retrofit , and for the images I decided to try Picasso . With the former library, I had a String parameter in each of my items containing the image URL, then I used myNetworkImageView.setImageUrl(item.getURL

Picasso Load image from filesystem

烈酒焚心 提交于 2019-11-26 04:45:32
问题 Can I use Picasso library to load images from the filesystem? I\'m using startActivityForResult to let the user pick a photo from his gallery, and then want to show the selected image. I already have working code to get the image filesystem Uri , but can\'t get the Picasso.load() method to work. 回答1: Of course you can. Its actually pretty straight forward: File f = new File("path-to-file/file.png") or File f = new File(uri) Picasso.with(getActivity()).load(f).into(imageView); also Picasso

Why use Android Picasso library to download images?

天大地大妈咪最大 提交于 2019-11-26 04:41:20
问题 Why should I download the images via the Picasso library instead of just using this code: private Bitmap DownloadImage(String URL) { Bitmap bitmap = null; InputStream in = null; try { in = OpenHttpGETConnection(URL); bitmap = BitmapFactory.decodeStream(in); in.close(); } catch (Exception e) { Log.d(\"DownloadImage\", e.getLocalizedMessage()); } return bitmap; } Another question: Does Picasso download the image in the UI or by background thread? 回答1: Just for the record for anyone new to

Use Picasso to get a callback with a Bitmap

回眸只為那壹抹淺笑 提交于 2019-11-26 01:59:08
问题 I\'m using Picasso to download images for my app. I\'m in a situation where I need to access the Bitmap first before it\'s loaded into the ImageView . The presence of the Downloader.Response class seems to suggest this is possible, but I can\'t find any use examples. I don\'t want to write a bunch more code to asynchronously handle this one particular case if it\'s possible to do with Picasso. Can anyone show me how to do it? 回答1: Found the answer on github in case anyone is wondering: