picasso

How to make Picasso load images faster?

大憨熊 提交于 2019-12-04 19:09:37
I use Picasso (image downloading library for Android). Picasso website I charge my image like this: Picasso.get().load("http://i.imgur.com/myImage.png").into(imageView); But, if myImage.png is too big, the download become slow. (With bad internet connection of course) How to make Picasso load images faster? Can I just make the quality lower by Picasso? Or can I charge them "early" a few seconds before using them? Note that I cannot touch the file myImage.png --------------------- EDIT Any idea how to charge an image "early"? Should I use invisible view and load image into it, then use the same

UIL, Picasso - Images in adapter always reload when stop scrolling

巧了我就是萌 提交于 2019-12-04 18:03:52
问题 I have ListView with text and large image from internet. My image item has fit width and wrap_content height. I tried to display image in background with UIL & Picasso . Both of them can work but the image always reloads when I stop scrolling, and it makes ListView flickering It looks like this: You can see that it reload downloaded and cached images when I stop scrolling (I scroll down and then scroll up) . How can I prevent this happen? <ImageView android:id="@+id/imgFeed" android:layout

Why does Picasso running in a background thread block onActivityResult?

☆樱花仙子☆ 提交于 2019-12-04 17:08:49
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 isn't called until the background thread that is loading the overlay finishes. Is there a reason that a

Get image uri from picasso?

偶尔善良 提交于 2019-12-04 16:29:16
问题 I have a fairly large list of image URL's that I'm using to load up a ViewPager using Picasso. I need to be able to provide sharing capabilities for these images via an intent (ultimately sharing via ShareActionProvider). From what I've read, Picasso isn't really built to handle this sort of thing out of the box, though it provides all the necessary tools to do so. My plan before research was to create a simple LruCache which uses the url as the key and bitmap value. This caching would occur

Sometimes Picasso doesn't load the image from memory cache

孤人 提交于 2019-12-04 14:37:35
问题 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

OkHttp + Picasso + Retrofit

允我心安 提交于 2019-12-04 09:53:33
问题 The question is how to combine all these 3 libraries in one project? Make one OkHttpClient to be a background layer for both Picasso and Retrofit. How to make Priority changes like in Volley lib. (for pagination)? 回答1: In a nutshell: OkHttpClient okHttpClient = new OkHttpClient(); RestAdapter restAdapter = new RestAdapter.Builder().setClient(new OkClient(okHttpClient)).build(); OkHttpDownloader downloader = new OkHttpDownloader(okHttpClient); Picasso picasso = new Picasso.Builder(this)

scaling image size in Picasso

大兔子大兔子 提交于 2019-12-04 09:35:18
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 screen width is 200 and the image is portrait 4x5 aspect, then the image should be display to 75%

how to use progressbar when loading image in picasso?

女生的网名这么多〃 提交于 2019-12-04 09:01:27
问题 I want onStart() method to load image from server using picasso and I want to show a progress bar until the photos are fully downloaded Here is my code: @Override protected void onStart() { // TODO Auto-generated method stub super.onStart(); Picasso.with(context).load(imageLoad) .placeholder(R.id.progressBarDetails) .error(R.drawable.friend_request).noFade().resize(200, 200) .into(avatarImage, new Callback() { @Override public void onError() { // TODO Auto-generated method stub } @Override

How to add Basic Authentication in Picasso 2.5.2 with OkHttp 3.2.0

和自甴很熟 提交于 2019-12-04 08:06:26
I am using the picasso 2.5.2 library to download the bitmap so in the api I need to pass the Basic Authentication in the headers. i have tried the following SO ansers but none of them work with the latest picasso and OkHttp libraries. Answer - 1 Answer - 2 Answer - 3 Thanks in advance. Try configuring an OkHttp3 client with authenticator, depending on your scheme and situation: OkHttpClient okHttpClient = new OkHttpClient.Builder() .authenticator(new Authenticator() { @Override public Request authenticate(Route route, Response response) throws IOException { String credential = Credentials

Android shared elements with Picasso

前提是你 提交于 2019-12-04 07:41:35
I'm trying to make an image transit from a list in one activity to a detail activity. In the detail activity the image is bigger than in the list and I'm using Picasso to retrieve the image from the server. The problem is that the first time I launch the detail activity, the image transit well but is not resized nor centered. When I go back, the image is instantly resized, and if I come back to the same detail activity, it works as expected. The detail activity call method: public static void launch(Activity activity, View transitionView, StoreProduct storeProduct) { ActivityOptionsCompat