picasso

Picasso doesn't cache image on disk

非 Y 不嫁゛ 提交于 2019-12-07 12:37:14
问题 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

Force re-downloading image with Picasso

谁说我不能喝 提交于 2019-12-07 09:01:03
问题 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? 回答1: Picasso.with(context)

Implementing ImageSlider GridView with Picasso

邮差的信 提交于 2019-12-07 02:48:29
I am trying to make a grid view gallery app. When a user clicks on an image, the full image is displayed. I just can't understand how I would implement ImageSlider and save the image to the gallery in my existing project. This is MainActivity: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); GridView gridView = (GridView) findViewById(R.id.grid); gridView.setAdapter(new ImageAdapter(this)); gridView.setOnItemClickListener(new AdapterView

Glide: log each request

自古美人都是妖i 提交于 2019-12-07 01:35:45
问题 Consider the code below: Glide.with(<your_context>) .load(<remote_file_url, local_file_path>) .into(<imageview>); Above Glide code is written in lots of file. Simply I want to log my remote_file_url or local_file_path in logcat. But I don't want to change the code in every file. Is Glide allowing logging? If it allows, then I need a simple central way to turn on glide logging. For Reference: I want the way like Retrofit + okhttp allow. In OkHttp , I just have to add interceptor at one

A/Looper: Could not create wake pipe. errno=24

一世执手 提交于 2019-12-06 21:28:49
问题 We're building an app that does a lot of animations and downloads a lot of images. After a certain amount of transactions (a predictable number), the app is crashing with the error: A/Looper: Could not create wake pipe. errno=24 We don't use Looper in our code, but a few of the libraries we use do use Looper: ActionBarSherlock: I don't think this is the culprit facebook: I don't think this is the culprit nineoldandroid: This animation library could be the culprit volley: This is probably not

Android Imge Picasso Square Cache Size

霸气de小男生 提交于 2019-12-06 17:27:12
Im using Picasso square library to load images in my android application. This works fine when doing it like this: Picasso.with(getApplicationContext()).load(Properties.IMAGE_URL + i).transform(transformation).centerCrop().fit().into(imgeButton); My problem is that the loading of the image is too slow and I would like the cache to be bigger than it is right now. I see that when working with only one image the cache works properly; The first time the image will not be cached and right after that every time the same code is called, the image will be fetched from the cached and not the network.

how to load bitmap directly with picasso library like following

谁都会走 提交于 2019-12-06 17:16:00
问题 Picasso.with(context).load("url").into(imageView); Here instead of url i want bitmap how can i achieve this. like below- Picasso.with(context).load(bitmap).into(imageView); 回答1: This should work for you. Use the returned URI with Picasso. (taken from: is there away to get uri of bitmap with out save it to sdcard?) public Uri getImageUri(Context inContext, Bitmap inImage) { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);

Is it absolutely correct that Picasso understands NOT to load if the view has been recycled?

蹲街弑〆低调 提交于 2019-12-06 16:56:19
I'm a little confused: as a rule when async loading images to some sort of list view (whether on Android or iOS or in the abstract on another platform), you essentially must do this .. -- make a note of "which" cell this is (say, #213) -- start getting the image from the net. -- it has loaded from the net. What cell are we now? -- if we are "still" 213, load the image to the image view! -- if we are "no longer" 213, just forget about it. this is a basic in lazy-loading async images. For example, Lucas Rocha explains it perfectly in a famous article here: http://lucasr.org/2012/04/05

Getting black ImageView using Picasso and Glide

喜欢而已 提交于 2019-12-06 16:30:02
问题 The problem I'm writing an Android app that's supposed to have a "Slideshow" feature on it. I've found this nice library, based on Picasso, that does exactly what I wanted, and it worked just fine most of the times. Problem is, sometimes my images are not loaded into the slide ImageView ... It only shows a "black canvas" as you can see on the screenshot below. I am loading the image from a local resource from my drawables. Sometimes it happens on Portrait mode, sometimes on Landscape mode. It

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

为君一笑 提交于 2019-12-06 13:44:42
问题 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