picasso

Set Cookie for Picasso

雨燕双飞 提交于 2019-11-29 11:06:59
im trying to set Cookie for picasso connections . i found this for OkHttp: OkHttpClient client = new OkHttpClient(); CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); client.setCookieHandler(cookieManager); the problem is i dont know where to set this for Picasso . All ideas accepted ! thanks You'll want to use OkHttpDownloader to tie the two together: OkHttpClient client = new OkHttpClient(); CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); client.setCookieHandler(cookieManager);

android picasso clear cache

假装没事ソ 提交于 2019-11-29 08:35:23
问题 I am using Picasso to show one's portrait, when the protrait is changed, I want to clear this user's cache(or all users' portrait cache), here is my code, and it doesn't work,anyone can help me? LruCache lruCache = new LruCache(context); lruCache.clear(); Picasso picasso = new Picasso.Builder(context).memoryCache(lruCache).build(); picasso.load(portraitUrl).resize(50, 50).centerCrop().error(R.drawable.user_portrait).into(portaitView); 回答1: In the recent versions of Picasso, there is a new

Picasso first run not call onBitmapLoaded in for loop

风流意气都作罢 提交于 2019-11-29 07:25:00
I have problem with get bitmap use Picasso in for loop. it is not called onBitmapLoaded in first run . second run it called for (int i = 0; i < 3; i++) { final int k=i; Picasso.with(this) .load(ListA.get(i).getImage()) //image .resize(100, 100) .transform(new ImageTrans_CircleTransform()) .into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { Log.i("load", "Ok " + k); //use bitmap for add marker to map } @Override public void onBitmapFailed(Drawable errorDrawable) { } @Override public void onPrepareLoad(Drawable placeHolderDrawable) { Log.i("load",

how to add picasso library in android studio

隐身守侯 提交于 2019-11-29 06:01:18
问题 I am getting this error, please help me. Error:A problem occurred configuring project ':app'. > Cannot evaluate module picasso-master : Configuration with name 'default' not found. Done so far : 1. download the picaso 2.unzip the zip folder 3.Under project section created one directory called as lib and add the unzip file 4. In settings-gradle include ':app' include ':libs:picasso-master' wrote these lines. 5. after that in project structure module dependency add the picasso library 6.

Getting Picasso to pre-fetch forthcoming images

家住魔仙堡 提交于 2019-11-29 01:26:00
I'm using Picasso with a GridView, loading 200 images over the network. Right now it looks like Picasso is not triggering an image load over the network until the image starts to come into view on the screen. Is there a way to have Picasso pre-fetch the next N images in the list so that the experience is better? I am using an Adapter to put the images into the Gridview. I am prefetching images into a cache very successfully using Picasso like so: if (BuildConfig.DEBUG) { Picasso.with(getApplicationContext()).setIndicatorsEnabled(true); Picasso.with(getApplicationContext()).setLoggingEnabled

How to load video thumbnails using square picasso library?

心已入冬 提交于 2019-11-29 01:17:33
Currently I'm loading MediaStore Image Thumbnails using picasso into the ListView with the following snippet: ( video.getData() returns the actual path of the image such as mnt/sdcard/... ) Picasso.with(this.context) .load(new File(photo.getData())) .resize(50, 50).config(config) .centerCrop() .into(viewHolder.imageViewItem); Now I'm and unable to load the MediaStore Video Thumbnails by just passing the video.getData() instead of photo.getData() ? Ram First You need to create VideoRequestHandler public class VideoRequestHandler extends RequestHandler{ public String SCHEME_VIDEO="video";

Picasso image loading issue in GoogleMap.InfoWindowAdapter

心已入冬 提交于 2019-11-28 23:59:14
I am using Google Maps Api and want to show an image inside InfoWindow when clicking of a Marker. I implemented it but there is a problem about Picasso. When I click a marker, infoWindow is shown up and imageView shows placeholder image. If I click same marker one more time, Picasso loads the image succesfully. I have to click twice, it is so weird. Screenshots for better understanding: First click on the marker: When I click again: There is my codes below: InfoWindowAdapter (Picasso loading here) mMap.setInfoWindowAdapter(new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow

Rounded corners with Picasso

大兔子大兔子 提交于 2019-11-28 23:33:07
Is there a reasonable way to do rounded corners with Picasso that Doesn't significantly slow down drawing Works with hardware layers Doesn't create an extra bitmap for each image Allows resizing the downloaded bitmap into the size of the destination imageview Most of the picasso advice on rounded corners suggests that a transformation be used, but I haven't seen an example that doesn't create an extra bitmap as part of the transformation. This seems to be because Picasso only uses bitmaps, while the tricks to do rounded corners use the fact that you can dynamically draw the rounded corners on

RecyclerView laggy scrolling

假装没事ソ 提交于 2019-11-28 23:15:59
I am loading 400x200 images in RecyclerView, but scrolling is laggy on 2k devices. I am using Picasso for loading images from resource. As you can see in the demo images are blurry on 2k screen, but if I load higher resolution images the situation gets worse. How to fix this, I am not even loading large image, its 400x200 ? Demo Here is my code card_view.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" card_view

2015-2016最火的Android开源项目--github开源项目集锦(不看你就out了)

那年仲夏 提交于 2019-11-28 22:42:27
2015-2016最火的Android开源项目 本文整理与集结了近期github上使用最广泛最火热与最流行的开源项目,想要充电与提升的小伙伴们可以前来一关哦~ 本文只提供了简单介绍与项目网址,具体请点进去自行参谋哦,费心整理,希望对大家有用 github开源项目地址: https://github.com/Trinea/android-open-project 网络请求 xutils3 基于 Afinal,包含 DbUtils、ViewUtils、HttpUtils、BitmapUtils 四大模块,可用于快速开发 github地址 : xutils3 集成方法 compile 'org.xutils:xutils:3.2.2' 使用方法:D:\study_forAndroid\第三方框架使用笔记\http\xutils3的使用.md library/demo地址:D:\study_forAndroid\demo\xUtils-master 相关博客: Xutils3的使用 Volley Google 提供的网络通信库,使得网络请求更简单、更快速 github地址: 集成方法:添加jar包 volley 使用方法: library/demo地址: 相关博客: Volley框架的使用 Asynchronous Http Client for Android Android 异步