picasso

Picasso Library and GridView Images

ε祈祈猫儿з 提交于 2019-12-01 04:45:40
I want to build an app that displays images in a gridview by using the picasso library. The images are retrieved by a remote server. Should I make an AsyncTask class or is this class handled by Picasso Library itself? All the picasso tutorials I have seen so far seem a bit vague. Thanks, Theo. Its very simple to use picasso lib for loading images in gridview, as demonstrated here , class SampleGridViewAdapter extends BaseAdapter { private final Context context; private final List<String> urls = new ArrayList<String>(); public SampleGridViewAdapter(Context context) { this.context = context; //

Fade in animation while loading image Using Picasso

我的梦境 提交于 2019-12-01 02:53:29
I want to show a fade effect when image is loading on Imageview. I am using picasso to cache image and display in image view. I have searched alot for this but couldnt find any solution. I have used earlier before and i know in some version they had .fade(int Duration) method to fade image while loading but i couldnt find this method anymore. Here is what i am doing now Picasso.with(context) .load(viewHolder.data.imageList.get(0).url) .networkPolicy(NetworkPolicy.OFFLINE) .placeholder(R.drawable.a_place_holder_list_view) .error(R.drawable.a_place_holder_list_view) .into(viewHolder.ivUser,

Picasso not loading the image

老子叫甜甜 提交于 2019-12-01 02:41:55
here's the code for picasso: ImageView img = (ImageView)findViewById(R.id.product_image); Picasso.with(this) .load(_url) .fit() .into(img, new Callback() { @Override public void onSuccess() { } @Override public void onError() { } }); here's the value of _url: http://kiagallery.ir/Images/Upload/Collection%20101/Spring%20101/d4a03b66dc7b46c694615c549b78b2e9.jpg and here's the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ImageView android:id="@+id

Picasso Images are not loading in Gridview Android

对着背影说爱祢 提交于 2019-11-30 23:38:31
I have been making a Movie App (project work for learning android on udacity btw). I encountered a few problems but resolved them by following threads such as these Unable to modify ArrayAdapter in ListView: UnsupportedOperationException However, although my app does not crash, the images are not loading and I cannot figure out why. Here is my code: Layout XMl files movies_item.xml <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id = "@+id/movies_item

Picasso not loading the image

不羁岁月 提交于 2019-11-30 22:34:50
问题 here's the code for picasso: ImageView img = (ImageView)findViewById(R.id.product_image); Picasso.with(this) .load(_url) .fit() .into(img, new Callback() { @Override public void onSuccess() { } @Override public void onError() { } }); here's the value of _url: http://kiagallery.ir/Images/Upload/Collection%20101/Spring%20101/d4a03b66dc7b46c694615c549b78b2e9.jpg and here's the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

Picasso Images are not loading in Gridview Android

非 Y 不嫁゛ 提交于 2019-11-30 18:53:31
问题 I have been making a Movie App (project work for learning android on udacity btw). I encountered a few problems but resolved them by following threads such as these Unable to modify ArrayAdapter in ListView: UnsupportedOperationException However, although my app does not crash, the images are not loading and I cannot figure out why. Here is my code: Layout XMl files movies_item.xml <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android"

Get Bitmap from ImageView loaded with Picasso

独自空忆成欢 提交于 2019-11-30 18:37:19
I had a method that loads images, if the image has not been loaded before it will look for it on a server. Then it stores it in the apps file system. If it is in the file system it loads that image instead as that is much faster than pulling the images from the server. If you have loaded the image before without closing the app it will be stored in a static dictionary so that it can be reloaded without using up more memory, to avoid out of memory errors. This all worked fine until I started using the Picasso image loading library. Now I'm loading images into an ImageView but I don't know how

Picasso loads into wrong imageview when using view holder pattern

爱⌒轻易说出口 提交于 2019-11-30 18:26:40
I'm trying to use the Picasso library to load external images into rows in a ListView . I have a custom ArrayAdapter as follows: public class RevisedBusinessesAdapter extends ArrayAdapter<HashMap<String, String>> { Context context; int layoutResourceId; ArrayList<HashMap<String, String>> data = null; public RevisedBusinessesAdapter(Context context, int layoutResourceId, ArrayList<HashMap<String, String>> data) { super(context, layoutResourceId, data); this.layoutResourceId = layoutResourceId; this.context = context; this.data = data; } @Override public View getView(int position, View

Using picasso library with a circle image view

試著忘記壹切 提交于 2019-11-30 17:13:24
I am looking at using the Picasso library to download an image from URL and pass this into circle image view, but since picasso requires that you pass in an actual imageView I have come to a standstill on how to do it I am using the picasso library from here http://square.github.io/picasso/ and the circle image view class from here https://github.com/hdodenhof/CircleImageView Here is the start of my code to get the image private void getData() { userName.setText(prefs.getString("userName","")); jobTitle.setText(prefs.getString("profile","")); userLocation.setText(prefs.getString("location","")

Is it possible to change the size of the cache Picasso uses for images?

旧时模样 提交于 2019-11-30 16:48:45
I'm loading images from URLs (http://) with Picasso. Sometimes when i try to "preload" an image using Picasso's fetch() method, the image doesn't get cached. I guess it's because it's size is too big. Read the answer for this question, but setCache() doesn't seem to be recognized for me, i don't even find it in the Picasso documentation. Is there any way to change the cache size Picasso uses for bitmaps? You can do: int maxSize = MAX_CACHE_SIZE; Picasso picasso = new Picasso.Builder(context) .memoryCache(new LruCache(maxSize)) .build(); Picasso uses a Cache interface type to manage the cache.