android-glide

Glide assert: java.lang.IllegalArgumentException: You must call this method on the main thread

萝らか妹 提交于 2019-12-01 13:58:59
问题 Has anyone used Glide to fetch images from a background thread? I keep getting this assert: java.lang.IllegalArgumentException: You must call this method on the main thread but according to this thread, it should work: https://github.com/bumptech/glide/issues/310 Yet, I cannot get it to work, unless I call it from the main thread. Here's is what I am trying to do from the main thread: Glide.get(mContext); loadUserImage(userImageUrl); // wait 5 seconds before trying again int

Glide 4.3.1 override and placeholder features not work

岁酱吖の 提交于 2019-12-01 13:58:19
问题 I update my glide to 4.3.1 but all over I use glide the feature .override() and .placeholder() get error: cannot find symbol method . Glide.with(this) .load(imageUrl) .override(200, 200) .placeholder(R.drawable.ic_avatar_sign_up) .into(ivAvatar); How can I fix this? 回答1: You should use RequestOptions Includes methods like: centerCrop() placeholder() error() priority() diskCacheStrategy() priority() override(100, 100) transforms() Sample code Glide.with(this) .load(YOUR_URL) .apply(new

Glide - call method after fallback or error when trying load photo

自作多情 提交于 2019-12-01 06:36:48
Glide - call method after fallback or error when trying load photo. Hi! Is there any a way to check if Glide load photo from link or use fallback / error when link isn't valid or photo isn't available? I mean, I want to call a method (load other photo) when Glide doesn't load photo. This is my Glide e.g.: Glide .with(mActivity) .load(news.getPagemap().getCseThumbnail().get(0).getSrc()) .fallback(R.drawable.bg_gradient) .error(R.drawable.bg_gradient) .centerCrop() .crossFade() .diskCacheStrategy(DiskCacheStrategy.SOURCE) .into(holder.photo); I tried to compare ConstantValues - holder.photo

How to download images with specific size from firebase storage

谁说我不能喝 提交于 2019-12-01 04:15:02
问题 I am using firebase storage in my android app to store images uploaded by users. all images uploaded are square in shape. I discovered that downloading this images consumes a lot of user bandwidth and i would like to reduce this consumption by reducing the size of image downloaded into a square imageview I am using Glide to download this images and i have tried to download images of custom size but the image is not appearing on the imageview. interface public interface MyDataModel { public

Android Glide placeholder size

怎甘沉沦 提交于 2019-12-01 03:04:46
I have a problem with Android Glide. I am trying to quickly swap my image, they just become all placeholder size, and my placeholder image is very low size. So what I need to do? Maybe I need to check if it's loaded or something, but I don't know how. Glide.with(this) .load(quest.get(id).getImage()) .placeholder(R.drawable.load) .fitCenter() .crossFade() .into(imageView); Ashkan Ghodrat According to this issue on Glide GitHub page you can fix it with adding following line to your request of Glide: .dontAnimate() That would make your full load line: Glide.with(context) .load("http://lorempixel

android studio : Cannot find symbol Class GlideDrawable

做~自己de王妃 提交于 2019-12-01 02:59:08
i'm having an issue with this project whenever i try to compile it displays the error Error: cannot find symbol class GlideDrawable please take a look at app:module dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:27.0.2' compile 'com.android.support:cardview-v7:27.0.2' compile 'com.android.support:appcompat-v7:27.0.2' compile 'com.android.support:design:27.0.2' compile project('

Android Glide placeholder size

自作多情 提交于 2019-12-01 00:01:23
问题 I have a problem with Android Glide. I am trying to quickly swap my image, they just become all placeholder size, and my placeholder image is very low size. So what I need to do? Maybe I need to check if it's loaded or something, but I don't know how. Glide.with(this) .load(quest.get(id).getImage()) .placeholder(R.drawable.load) .fitCenter() .crossFade() .into(imageView); 回答1: According to this issue on Glide GitHub page you can fix it with adding following line to your request of Glide:

android studio : Cannot find symbol Class GlideDrawable

时间秒杀一切 提交于 2019-11-30 22:58:54
问题 i'm having an issue with this project whenever i try to compile it displays the error Error: cannot find symbol class GlideDrawable please take a look at app:module dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:27.0.2' compile 'com.android.support:cardview-v7:27.0.2' compile 'com

Captcha image cannot be refresh by using Glide

强颜欢笑 提交于 2019-11-30 21:18:21
I have tried to use Glide to load an Captcha image into a ImageView. The first time loading is fine. However, when I reload the Captcha image into the same ImageView, the ImageView does not refresh to new image. Does anyone have idea how to solve this issue? String url = "https://captcha_path"; ImageView imgView = (ImageView)getActivity().findViewById(R.id.imgView); Glide.with(getActivity()).load(url).asBitmap().diskCacheStrategy(DiskCacheStrategy.NONE).into(imgView); You can always use Glide.clear() and then call Glide.with(...).load() again. If your url doesn't change when the image changes,

RecyclerView Recycled ViewHolder Image View wrong size

流过昼夜 提交于 2019-11-30 20:28:14
I have a recycler view with different View Holders. A couple of view holders have image views which I pass into Glide to display images. The problem is, when the recycler view starts recycling views, the imageview width/height are that of the recycled view they then display the image incorrectly. Here is my ImageView: <ImageView android:id="@+id/image" android:layout_marginTop="@dimen/feed_item_margin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center"/> This is passed into Glide Glide.with(itemView.getContext()) .load(Uri.parse(MediaUtils