picasso

Importing Picasso and OkHttp in Eclipse

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to expose some Picasso resources to satisfy a rather strange request. For this I need to import Picasso as a library project instead of a compiled jar. I've created a new Android Project and copied the contents of picasso\picasso\src\main\java (cloned master) to the src folder. Picasso uses OkHttp so I downloaded the latest release jar (2.3.0) and put it in the libs folder of the Picasso project; added it to the build path; selected the jar in the build path "Order and Export" preferences. Finally, I made the Picasso project a library

Picasso clear memory [duplicate]

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Load large images with Picasso and custom Transform object 2 answers I have many images loaded using Picasso in a view flipper which is in a fragment. I want to know if the images are still in memory when I change to a different fragment. If they persist in the memory how can I remove them. Any suggestions on any other method to load images to a view flipper would be appreciated. The images are in the internal memory of the device. Thanks in advance. 回答1: Try.. setIndicatorsEnabled(true) . It refers

Sometimes Picasso doesn't load the image from memory cache

不问归期 提交于 2019-12-03 10:09:19
private class CustomAdapter extends CursorAdapter { @Override public void bindView(View view, Context context, Cursor cursor) { if (view != null) { String url = cursor.getString(CONTENT_URL_COLUMN); ViewHolder viewHolder = (ViewHolder) view.getTag(); final ImageView imageView = viewHolder.mImageViewIcon; final TextView textView = viewHolder.mTextViewName; Picasso.with(context).load(url).into(new Target() { @Override public void onBitmapLoaded(Bitmap arg0, LoadedFrom arg1) { imageView.setImageBitmap(arg0); imageView.setVisibility(View.VISIBLE); textView.setVisibility(View.GONE); } @Override

Android - use picasso to load image without storing it in cache

一个人想着一个人 提交于 2019-12-03 09:35:56
I want to use picasso to load an image from a url into a placeholder, but not store that image in cache - in other words, I want the image to be downloaded from the net directly to disk and then loaded from disk when needed. I understand there's a class called RequestCreator where you can specify memory policy - does anyone have an example of using picasso/requestcreator to do something like this? So.. something like: RequestCreator requestCreator = new RequestCreator(); requestCreator.memoryPolicy(MemoryPolicy.NO_CACHE); .... merged with: Picasso.with(context).load(someurl).fit().placeholder

Picasso - transformation bitmap quality

匿名 (未验证) 提交于 2019-12-03 09:06:55
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am downloading low resolution pictures from web by using Picasso and displaying it in high res displays. Fetching images is straightforward: Picasso.with(context) .load(item.getPicture()) .transform(new BitmapTransformations.OverlayTransformation( context.getResources(), R.drawable.ic_play_video)) .error(R.drawable.picture_placeholder) .into(target); Notice that I apply Overlay transformation into request - It's a high quality image asset I put on top of downloaded image. Applying overlay is also simple - just resize bitmap and put it in

Picasso onBitmapLoaded never called

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: 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,

How to load image from aws with picasso with private access

寵の児 提交于 2019-12-03 08:40:56
I'm trying to load image stored on aws S3 into my android app using Picasso but I am getting a blank image with no errors in my logcat and nothing to me from general debugging around the relevant lines of code. We are having private access on images so image url can't work on browser. i need to display image into my android app using Picasso. but it doesn't work. My code snippet below new Picasso.Builder(getApplicationContext()).downloader(new S3Downloader(getApplicationContext(), s3Client, bucket)) .build() .load("https://s3-ea-east-8.amazonaws.com/music/MusicApp_3.jpg") .placeholder(R

Is there any way from which we can detect images are loading from cache in picasso?

匿名 (未验证) 提交于 2019-12-03 08:28:06
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: as title suggest I want to check whether images are loading from cache or not. I've done something like this but couldn't succeeded. Picasso.with(getApplicationContext()) .load(data.get(position).get("product_image")) .into(viewHolder.imgViewIcon, new Callback() { @Override public void onSuccess() { viewHolder.imgViewIcon.setVisibility(View.VISIBLE); if (Picasso.LoadedFrom.NETWORK != null) YoYo.with(Techniques.ZoomIn).duration(1200) .playOn(viewHolder.imgViewIcon); viewHolder.placeholder.setVisibility(View.GONE); } @Override public void

Downloading multiples images from Picasso in Android

最后都变了- 提交于 2019-12-03 07:50:29
I'm using Picasso library to download images from URL. This is my first attempt on Picasso Scenario : I want to download some images from server and store them into a file. I know how to store into file and retrieve. When I ran the below code, I happen to see that I'm getting only last image. It seems like Picasso runs parallelly. I checked it by displaying a toast message. Is there anyway to solve this issue? Problem : I'm getting only the last url image. Here's my code static int count = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Picasso keeps reloading images while scrolling upwards in listview, loads slowly

一世执手 提交于 2019-12-03 05:49:58
I have been searching SO threads for answers but couldn't figure out my issue from previous discussion. I have a listview which loads about 50 images (it used to be about 100 but this was barely loading any images at all). After grabbing my JSON content (including image URL) from an api endpoint, through an adapter, my code puts it inside the listview. Currently, with 50 images, picasso will load one image at a time as I scroll down on the feed. I feel as if keeping the scroll fixed on one item in the listview will make that image load faster. As I scroll up, however, it puts the placeholder