picasso

Picasso loads pictures to the wrong imageview in a list adapter

安稳与你 提交于 2019-11-27 21:13:17
问题 I'm loading an image from a server to a list view item using picasso like this: public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View participantView; if(convertView == null) { participantView = inflater.inflate(R.layout.participant_item, parent, false); } else { participantView = convertView; } TextView textView = (TextView) participantView.findViewById(R.id

cannot find symbol method with() using picasso library android

梦想的初衷 提交于 2019-11-27 21:02:14
i'm getting one issue in android app, I am trying to check already existing app, the app contains implementation('com.squareup.picasso:picasso:3.0.0-SNAPSHOT') { exclude group: 'com.android.support' } picasso library and using that library in a class, here is the code import com.squareup.picasso.Picasso; Picasso.with().load(url).placeholder(R.drawable.default_pic).into(imageView); here is the error, Error:(49, 20) error: cannot find symbol method with() and my android studio version is 3.0 RC1, is this is an issue ? It looks like in the latest Picasso Snapshot that you are using the method

Clear Cache memory of Picasso

六月ゝ 毕业季﹏ 提交于 2019-11-27 20:45:34
I'm trying to clear the cache memory of Picasso via Android coding. Can anyone please help me in this issue..? I have tried using the following code, but this was not useful in my case: Picasso.with(getActivity()).load(data.get(pos).getFeed_thumb_image()).skipMemoryCache().into(image); Use this instead : Picasso.with(getContext()).load(data.get(pos).getFeed_thumb_image()).memoryPolicy(MemoryPolicy.NO_CACHE).into(image); Murtaza Khursheed Hussain Remove cache of Picasso like this. public class Clear { public static void clearCache (Picasso p) { p.cache.clear(); } } This util class can clear the

getting image width and height with picasso library

无人久伴 提交于 2019-11-27 20:40:08
i'm using picasso library to download and load images into imageView. now i want to know how i can get image width and height before loading them in imageViews ? i have a listview with an adapter that contains two imageView(one of them is vertical and another is horizontal). depends on image width and height i want to load image into one of the imageviews. You can get Bitmap dimensions only after downloading It - you must use synchronous method call like this: final Bitmap image = Picasso.with(this).load("http://").get(); int width = image.getWidth(); int height = image.getHeight(); After this

Adding borders for image rounded image android

只愿长相守 提交于 2019-11-27 19:50:42
What i have :: I have a Imageview for which i am making image as a circle using picassso What i what to do :: I want to add a black border for rounded image using my current implementation, how to achieve this without using third party library Picasso.with(this) .load("http://i.imgur.com/DvpvklR.png") .transform(new RoundedTransformation(50, 4)) .resize(100, 100) .centerCrop().into(imageView1); RoundedTransformation.java // enables hardware accelerated rounded corners // original idea here : http://www.curious-creature.org/2012/12/11/android-recipe-1-image-with-rounded-corners/ public class

First time error loading picture with Picasso

最后都变了- 提交于 2019-11-27 19:04:47
问题 I have an Activity with an ImagePagerAdapter (extends of FragmentStatePagerAdapter ) that has this getItem method: @Override public Fragment getItem(int position) { Log.d(LOGTAG, "------------>mUserPicturesList.get("+position+").getFilename(): " + mUserPicturesList.get(position).getFilename()); return UserDetailFragment.newInstance(mUserPicturesList.get(position).getFilename()); } The fragment that is instantiated has this onCreateView: @Override public View onCreateView(LayoutInflater

How to listen for Picasso (Android) load complete events?

可紊 提交于 2019-11-27 18:26:24
Is there a way to listen for events from Picasso when using the builder like: Picasso.with(getContext()).load(url).into(imageView); I'm trying to call requestLayout() and invalidate() on the parent GridView so it'll resize properly but I don't know how to set a listener or callback. I see that Picasso has error event reporting, but is there a success event? MrEngineer13 You can use a Callback to get onSuccess and onError events. Just add a new Callback to your request like so: Picasso.with(getContext()) .load(url) .into(imageView, new com.squareup.picasso.Callback() { @Override public void

How To Load Layout Background Using Picasso

给你一囗甜甜゛ 提交于 2019-11-27 14:09:18
问题 Can anyone point me towards an example of how one might change an XML layout's background programatically using Picasso? All the examples I've found are able to update an ImageView using Picasso - but not a layout background. Unable to set LinearLayout BackgroundResource from URL using Picasso 回答1: You can use Picasso's Target: Picasso.with(this).load("http://imageUrl").into(new Target() { @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) { mYourLayout.setBackground

Preload images into memory/disk with Android Picasso

江枫思渺然 提交于 2019-11-27 13:58:18
问题 Can I download images with Picasso before displaying them? I want to cache images first. Sample scenario: User clicks on the button, sees the progressbar, and when the images have finished loading user see the images on the screen. I tried to load images with the "get" method but that did not cache the images. Thread thread = new Thread() { @Override public void run() { try { Picasso picasso = PicassoOwnCache.with(getApplicationContext()); RequestCreator picassoRequest; for (String imgUrl :

Saving image from url using Picasso?

六眼飞鱼酱① 提交于 2019-11-27 13:55:25
I'm trying save an image using API Picasso. To do it I'm trying use Target to save but I can't do this work. How could I do this ? Trying //save image public static void imageDownload(Context ctx){ Picasso.with(ctx) .load("http://blog.concretesolutions.com.br/wp-content/uploads/2015/04/Android1.png") .into(getTarget("http://blog.concretesolutions.com.br/wp-content/uploads/2015/04/Android1.png")); } //target to save private static Target getTarget(final String url){ Target target = new Target(){ @Override public void onBitmapLoaded(final Bitmap bitmap, Picasso.LoadedFrom from) { new Thread(new