picasso

How to update the selector(StateListDrawable) images using picasso

烂漫一生 提交于 2019-12-11 20:22:18
问题 I want to load a two images from their own url using picasso and use them as a statelist like: <item android:drawable="@drawable/sidebar_news_selected" android:state_selected="true"/> <item android:drawable="@drawable/sidebar_news_selected" android:state_activated="true"/> <item android:drawable="@drawable/sidebar_news_normal"/> how can i do that? Update : Thanks to Maddy , i tried his answer and now i stock in that like this: final StateListDrawable drawable = new StateListDrawable(); final

Load images for different screen sizes from the server using picasso?

爱⌒轻易说出口 提交于 2019-12-11 14:35:01
问题 Hello i am making an android app in which i am getting images from the server and for that i am using picasso library now my question is that as there are different densities of screens with different sizes including (ldpi, mdpi, hdpi, xhdpi )required for different devices now i want to know in background does picasso itself do something so that if i will open an high density pic on an small screen size mobile then it will not get blurred or something or hang my phone or anyway so that it can

How to compress image using Picasso Library for Android?

孤者浪人 提交于 2019-12-11 13:48:40
问题 My Application captures Image using Camera Intent. The image is saved to a file as "abc.jpg". Now using Picasso Library I try to compress the image by resizing it. I dont get any output. My code never reaches the Target's onBitmapLoaded neither onBitmapFailed. Here is my code. public static final String DATA_PATH = Environment .getExternalStorageDirectory() + "/SnapReminder/"; File file1 = new File(DATA_PATH); file1.mkdirs(); String _path = DATA_PATH + "abc.jpg"; File file = new File(_path);

Picasso IllegalArgumentException

有些话、适合烂在心里 提交于 2019-12-11 13:24:48
问题 I'm trying to use Picasso to load facebook photos for a listview. I'm getting " java.lang.IllegalArgumentException: Target must not be null " on this line: .into(holder.userpicture); If the userpicture ImageView is the 'target', then I don't understand. My guess is that it has something to do with my adapter, but I can't figure out what. All help greatly appreciated! EDIT I found the problem. I made a careless mistake. On this line, I forgot the convertView part: holder.userpicture=(ImageView

Android Picasso: Not Loading in Fragment

守給你的承諾、 提交于 2019-12-11 13:22:34
问题 I am giving Picasso a try for some easier memory management with images. I have just been trying to implement it within my fragment however I can't seem to get it to work. mainLayout.setBackground(new BitmapDrawable(getResources(), Picasso.with(mainLayout.getContext()).load(R.drawable.background2).get())); Where mainLayout is a LinearLayout. I also tried this: Picasso.with(getActivity().getApplicationContext()).load(R.drawable.background2).into(imageView1); I have tried Picasso.with(this)...

Picasso not showing Images from gallery on certain Samsung devices

寵の児 提交于 2019-12-11 12:04:29
问题 On some (all?) Samsung devices (Galaxy S5, S3) Picasso does not display Images from the Gallery. This is the code: File[] picFiles = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).listFiles(); File file = picFile[0]; I tried: Picasso.with(getActivity()).load(Uri.fromFile(file)).into(imageView); as well as Picasso.with(getActivity()).load("file://" + file.getAbsolutePath()).into(imageView); to no avail. On all non-samsung devices boths snippets work fine: The

picasso - load image into imagebutton in adapter

馋奶兔 提交于 2019-12-11 11:28:06
问题 I want to load an image into a ImageButton in an adapter, this is sometimes not working... I have a adapter with 4 entries, and sometimes, the button image is just loaded 2 times instead of 4 times. Always only on the first creation of the adapter... After screen rotation or so, everything works fine... But on the first display, it does not work correctly... The adapter with 4 rows calls 2 times prepare and two times loaded on the first creation only... Following is my adapter's getView :

Stuttering Listview despite ViewHolder, LazyLoader and simple Layout

。_饼干妹妹 提交于 2019-12-11 11:08:21
问题 I have a listview that loads images from a server into an ImageView. The Listview implements the viewholder pattern and has a very simple relative-layout for the rows. For lazy image loading, I have tried universalimageloader, picasso and am currently using glide, which is based on google volley, which should be blazing fast. However: My listview still stutters while replacing the placeholder image with the servers image and I just cant figure out why, here is my adapter-code: @Override

picasso throw an exception: context == null

*爱你&永不变心* 提交于 2019-12-11 09:09:07
问题 i use it load image into view at RecyclerView, but throws an exception : context == null, and its occured when i got androidX. its working fine before i update; thanks for helping ^.^ java.lang.IllegalStateException: context == null at com.squareup.picasso.Picasso.get(Picasso.java:681) at com.android.mytestdemo.presenter.NewsInfoViewHolder.setData(NewsInfoViewHolder.java:67) at com.android.mytestdemo.presenter.NewsInfoViewHolder.setData(NewsInfoViewHolder.java:14) at com.jude.easyrecyclerview

displaying album art for music using picasso

一笑奈何 提交于 2019-12-11 08:26:49
问题 Hello I need to display album art for music files efficiently using Picasso . I already configured picasso in my app. But I am not able to display album art from internal storage for music files. I tried this code but it's not working means no error but it doesn't display anything. Using uri : cursor = getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, MediaStore.Audio.AudioColumns.DURATION + ">0", null, sortOrder); cursor.moveToFirst(); a = cursor.getString(cursor