android-glide

Images disappear when scrolling up and down and spaces increase between images using Glide and RecyclerView

*爱你&永不变心* 提交于 2020-01-03 15:59:00
问题 I have a RecyclerView to display my images and I use Glide to load images from their URLs from my database in Firebase Storage. The problem is, when I scroll up and down, images reload and sometimes disappear and spaces between each image increase. How can I stop this? My RecyclerViewAdapter @Override public myViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = LayoutInflater.from(parent.getContext()).inflate(R.layout.image_layout,parent,false); myViewHolder

How to set bitmap image in Glide on Android

心不动则不痛 提交于 2020-01-03 14:28:32
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

How to add crossfade animation to GenericRequestBuilder in Glide

你说的曾经没有我的故事 提交于 2020-01-02 08:58:13
问题 I load images with this builder Glide.with(ctx) .using(new FileModelLoader(downlaoder), FilePath.class) .from(FileReference.class) .as(Bitmap.class) .decoder(new FilePathDecoder(ctx)) .diskCacheStrategy(DiskCacheStrategy.NONE); The problem is: there is no crossfade animation. So how do i return it? I need a custom ResourceDecoder because for some models I have to load webp with transparancy which is not supported on all android versions. So my question is how do I return crossfadeAnimation to

Loading image with glide is slow

落花浮王杯 提交于 2020-01-02 02:54:06
问题 I have app connect with server and when pics load seems so slow and when scroll that up and down seems glide want read image again! This is my adapter of glide: DataAdapter : public class DataAdapter extends RecyclerView.Adapter<DataAdapter.ViewHolder> { private Context context; private ArrayList<AndroidVersion> android; public DataAdapter(Context context,ArrayList<AndroidVersion> android) { this.context = context; this.android = android; } @Override public DataAdapter.ViewHolder

Glide callback after success in Kotlin

末鹿安然 提交于 2020-01-02 01:20:14
问题 private SimpleTarget target = new SimpleTarget<Bitmap>() { @Override public void onResourceReady(Bitmap bitmap, GlideAnimation glideAnimation) { // do something with the bitmap // for demonstration purposes, let's just set it to an ImageView imageView1.setImageBitmap( bitmap ); } }; private void loadImageSimpleTarget() { Glide.with(context) .load(uri) .override(600, 600) .fitCenter() .into(target); } I tried to convert it into Kotlin like as follow. val finish_target = object : SimpleTarget

How to use Glide in remoteViews?

孤街醉人 提交于 2020-01-01 04:35:30
问题 I'm using Glide for all loading images from server, but I'm having troubleshooting trying to set them in a correct way to notifications and RemoteControlClientCompat (that cool thing with lock screens). I am developing a music player, so every time that a song is changed the song cover from notifications has to change. I have this code and it works for the first time (althoug the image is load from url or from drawable), but not when it is called for second time. The image doesn't change!

Glide. Cache to External Storage (SD card)

不羁的心 提交于 2020-01-01 01:54:12
问题 I use Glide for loading Images in my android application. After 3.5 update, developers provided GlideModule interface. According to this article (Disk Cache) I can set cache directory, using setDiskCache method and ExternalCacheDiskCacheFactory . But I doesn't see any difference. All cache still on the Internal storage in default cache directory. build.gradle : dependencies { ... compile 'com.github.bumptech.glide:glide:3.6.1' } Android Manifest : <uses-permission android:name="android

Android - How to Load Image by name using Glide

我的梦境 提交于 2020-01-01 01:15:13
问题 Hi im using Glide to load image from my drawable folder and all works fine, this is my code : Glide.with(this).load(R.drawable.my_drawable_image_name).into(myImageView); i'm wondering if there is a way to load the image just by name , something like : Glide.with(this).load(my_drawable_image_name).into(myImageView); because i want to get the image name dynamically ,for example from a database... do you have any suggestion about that? thanks in advance. 回答1: Call getImage method for get

Storing and Displaying Image using Glide & FireBase android

大憨熊 提交于 2019-12-30 05:29:12
问题 I am trying to upload and display the profile picture using Glide & Firebase. Upload part is successfully working. But if i try to load that image from Database its showing blank.My motive is to load the profile_image while the user entered into the activity once and he can tap on the existing image and change that for his wish. My code public class User extends AppCompatActivity { private ImageView imageView; private Uri filePath; private final int PICK_IMAGE_REQUEST = 71; StorageReference

Why Glide blink the item ImageView when notifydatasetchanged

空扰寡人 提交于 2019-12-29 04:19:08
问题 I am using Glide 3.7.0 with RecyclerView . The item view always blinks when refreshing (calling notifyDataSetChanged ). Here is my code: Glide .with(context) .load(filepath) .diskCacheStrategy(DiskCacheStrategy.NONE) .skipMemoryCache(true) .dontAnimate() .into(imageview); When I use no cache, the ImageView has a null Bitmap when notifyDataSetChanged method is called and Glide hasn't finished loading the bitmap. If I use the code below: Glide .with(context) .load(filepath) .dontAnimate() .into