picasso

Why does Picasso running in a background thread block onActivityResult?

℡╲_俬逩灬. 提交于 2019-12-06 11:54:47
问题 We are working on a share mode for photos in an app, and one of the share options is to load an overlay for the image online. If the user shares the photo before the overlay finishes loading we are sending an intent with the unmodified image to share to other apps with startActivityForResult, and then in onActivityResult we are returning the user to the normal photo view from the share view. The issue we are running into is that when the user returns from sharing the photo, onActivityResult

Picasso New Version 2.5.2: Not Working with Transformation

孤街醉人 提交于 2019-12-06 11:35:15
Hello Picasso+Android Users, I have used following version of Picasso and its working with following Transformation snippet: compile 'com.squareup.picasso:picasso:2.3.2' and created following Transformation for Image Transformation : public class ImageTransformation implements Transformation { int maxWidth; int maxHeight; public ImageTransformation(ImageView imageView) { this.maxWidth = imageView.getWidth(); this.maxHeight = imageView.getHeight(); } @Override public Bitmap transform(Bitmap source) { int targetWidth, targetHeight; double aspectRatio; if (source.getWidth() > source.getHeight())

Callback weird behaviour (Android, Picasso library)

房东的猫 提交于 2019-12-06 09:14:29
I am using Picasso library to manage my image uploading and caching. When I am trying to execute this code: Picasso.with(this) .load(AppServer.getImageUrl() + "/" + eventInfo.getImageName()) .placeholder(R.drawable.calendar) .error(R.drawable.calendar) .into(new Target() { @Override public void onPrepareLoad(Drawable drawable) { } @Override public void onBitmapLoaded(Bitmap photo, Picasso.LoadedFrom from) { cropImage(photo); //not getting here } @Override public void onBitmapFailed(Drawable arg0) { } }); I am not entering int the onBitmapLoaded callback. Only if I close the activity (going

Passing header to Picasso while viewing the image using url - Android

泪湿孤枕 提交于 2019-12-06 06:22:08
问题 I need to pass a header when I try to show a image using Picasso. Can any one suggest how to add header to picasso while viewing the image. 回答1: You can use downloader for that: https://github.com/JakeWharton/picasso2-okhttp3-downloader Example: OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new Interceptor() { @Override public Response intercept(Chain chain) throws IOException { Request newRequest = chain.request().newBuilder() .addHeader("custom-header", "custom-header

RecyclerView -- 给你一个不卡的滑动列表

耗尽温柔 提交于 2019-12-06 06:17:47
https://www.jianshu.com/p/519bb23987ca 看完此文章 你就会学到什么... RecyclerView添加头部,尾部,或list列表中某位置添加view RecyclerView+SwipeRefreshLayout 实现上下拉刷新效果 分页加载数据 列表优化方案 利用Glide加载图片,滑动的时候按back键,App会crash蹦掉处理。 添加依赖 //recyclerview compile 'com.android.support:recyclerview-v7:25.1.1' //glide compile 'com.github.bumptech.glide:glide:3.7.0' //butterknife 注意需要在三个第三添加代码 //1 module gradle里面底部添加 compile 'com.jakewharton:butterknife:8.5.1' annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' //2 module gradle 里面顶部添加 apply plugin: 'com.jakewharton.butterknife' //3 在project gradle里面添加 dependencies { classpath

Picasso showing blue red and green arrows on top corner

老子叫甜甜 提交于 2019-12-06 06:05:55
I am using picasso to fire up an image in imageView. Here is the code ImageUtils.setImageFromUrl(app.selectedRing.getMainPicture(), imageView, MainActivity.this); public static void setImageFromUrl(final String url, final ImageView imgView, final Context mContext) { Picasso.with(mContext) .load(url) .networkPolicy(NetworkPolicy.OFFLINE) .fit().centerInside().placeholder(null) .into(imgView, new Callback() { @Override public void onSuccess() { } @Override public void onError() { Picasso.with(mContext) .load(url) .fit().centerInside() .into(imgView, new Callback() { @Override public void

scaling image size in Picasso

不打扰是莪最后的温柔 提交于 2019-12-06 05:52:32
问题 I want to download an image from a URL and display it in a View in my fragment. I am using Picasso to do this but I want the image to display in it's original aspect ratio but scaled to be a reasonable size - ie 75% of the screen width. I want to support both landscape and portrait photos. So the thinking is something like this. If the screen width is 200 and the image is landscape 5x4 aspect, then the image should be displayed to 75% width - ie 150 and 120 height (keeping proportions) If the

Android - How can diplay pictures in a simpleApapter list view

筅森魡賤 提交于 2019-12-06 05:50:36
I'm trying to display te pictures in a SimpleAdapter listview. I included Picasso in my project but i don't know how to use Picasso with a SimpleAdapter. List<HashMap<String, String>> featured = new ArrayList<HashMap<String, String>>(); for (int i=0;i<ids.length;i++){ HashMap<String, String> hm = new HashMap<String, String>(); hm.put("productname", names[i]); hm.put("productprice", prices[i]); hm.put("productimage", images[i]); featured.add(hm); } String[] from = {"productname", "productprice", "productimage"}; int[] to = {R.id.tv_ProductName, R.id.tv_ProductPrice, R.id.icon}; SimpleAdapter

Custom Downloader using Picasso

泄露秘密 提交于 2019-12-06 01:52:32
问题 I have to download an image from a URL which requires some headers ( username,password) along with the request. So i am doing that using the code given here. But calling this function gives the error java.lang.NoClassDefFoundError: com.squareup.okhttp.OkHttpClient at com.squareup.picasso.OkHttpDownloader.<init>(OkHttpDownloader.java:72) I am using Picasso 2.3.3 and okhttp-urlconnection-2.0.0-RC2 libraries The issue has been raised in this post also but changing to 2.3.2 doesnt work. 回答1: Do

Android: Didn't find class “Picasso” on path: DexPathList (Failed resolution of: Picasso)

假如想象 提交于 2019-12-06 01:11:10
First of all I know this error has been asked already but my case is a little different: I'm distributing SDK (Android library project). My SDK needs among others things (play services, support v4, gson jars etc.) Picasso so I have in my gradle.build : compile 'com.squareup.picasso:picasso:2.5.2' Now when I test importing the resulted aar file from this library project to my sample app - all works fine. The problem is that my customer when importing the aar file into his app project, trying to launch inside his app the Activity related with my SDK functionality getting the above error: Failed