android-glide

GlideApp not found using LibraryGlideModule (Glide 4)

泄露秘密 提交于 2019-11-27 19:36:45
问题 Using Glide 4 in combination with okhttp3 and a LibraryGlideModule: @GlideModule public final class MyGlideModule extends LibraryGlideModule { @Override public void registerComponents(Context context, Glide glide, Registry registry) { registry.replace(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory()); } } The GlideApp class is not generated when building, while it is when I extend AppGlideModule. Using LibraryGlideModule there seems to be no generated Glide classes at all.

Is there a way to load image as bitmap to Glide

孤街浪徒 提交于 2019-11-27 19:23:15
Im looking for a way to use bitmap as input to Glide. I am even not sure if its possible. It's for resizing purposes. Glide has a good image enhancement with scale. The problem is that I have resources as bitmap already loaded to memory. The only solution I could find is to store images to temporary file and reload them back to Glide as inputStream/file.. Is there a better way to achieve that ? Please before answering .. Im not talking about output from Glide.. .asBitmap().get() I know that.I need help with input. Here is my workaround solution: Bitmap bitmapNew=null; try { // ContextWrapper

Glide does not resolve its method

狂风中的少年 提交于 2019-11-27 19:14:24
Today I'm trying to use Glide image loader in my android application while using this I had facing method not resolving problem. Glide .with(this) .load(R.drawable.image_default_profile_picture) .into(mUserImage); This code working pretty fine. But when I'm trying this Glide .with(this) .load(R.drawable.image_default_profile_picture) .placeholder(R.mipmap.ic_launcher) .fitCenter() .into(mUserImage); Then this saying cannot resolve method fitCenter() , placeholder . What I am missing? Pehlaj Seems like updated library has any issue. Add .apply(new RequestOptions() to continue with latest

Recyclerview Adapter and Glide - same image every 4-5 rows

前提是你 提交于 2019-11-27 18:30:40
I have this problem - just for testing purposes I added ParseFile to one of ParseObject from received list. Instead of showing it only in that row it shows every 4-5 rows, sometimes more, sometimes less. I supspect that recycling view have something to do with this. Strangely, other data (deleted from this example) works fine with position variable. @Override public void onBindViewHolder(ViewHolder holder, int position) { if(parseList.get(position).get("logo") != null){ ParseFile image = (ParseFile) parseList.get(position).get("logo"); String url = image.getUrl(); Glide.with(context) .load(url

Android Glide: How to download and cache bitmaps?

一世执手 提交于 2019-11-27 16:22:41
问题 I am using Glide to download and cache images on Android. Everything works well except the fact that I don't want to load the bitmaps directly into the ImageView , I don't want to have the fade animation, neither image placeholders. All I want is to create a global method which will help me to download the image all over the application. public class MyApp extends Application { public static void downloadImage(String url, final OnImageLoadedCallback callback) { // And how to implement the

Memory not freeing after fragment is removed

假装没事ソ 提交于 2019-11-27 16:22:28
问题 I have a Fragment which has a RecyclerView . In this RecyclerView , I may occasionally download and display images (loaded with Glide into ImageView . So when I open the Fragment , used memory may sometimes jump from around 30MB to around 100MB or even more. After the Activity that is holding the Fragment is finished, the memory does not free up. It stays the same as before. I checked Glide documentation and apparently we don't have to worry about freeing up Bitmaps in RecyclerView . This is

Glide images sometimes are not loading

雨燕双飞 提交于 2019-11-27 15:58:28
Is a quiz game and the answer can be text or image, i'm using Gilde image to load it but for some users the images can't load, even if the internet is good and the images are in low quality. I'll copy all the code because i have no idea if is Gilde problem or not. if (AppConstant.arQuestionList.get(questionid).getArAnswer().get(i).getAtype() .equalsIgnoreCase("image")) { txtOption = new ImageView(this); try { Glide.with(QuestionActivity.this).load(AppConstant.arQuestionList.get(questionid) .getArAnswer().get(i).getAnswer()).override(60, 60).into((ImageView) txtOption); }catch (OutOfMemoryError

Glide load local image by Uri.

自作多情 提交于 2019-11-27 12:23:15
I'm trying to use Glide to load an image from local storage with no success. Glide.with(mContext) .load(pictureUri) // Uri of the picture .transform(new CircleTransform(..)) .into(profileAvatar); This is the error I get: java.lang.Exception: Failed to load model: '/storage/emulated/0/DCIM/Camera/IMG_20150831_180900.jpg' at com.bumptech.glide.request.GenericRequest.onSizeReady(GenericRequest.java:441) at com.bumptech.glide.request.target.ViewTarget$SizeDeterminer.getSize(ViewTarget.java:211) at com.bumptech.glide.request.target.ViewTarget.getSize(ViewTarget.java:100) at com.bumptech.glide

Preload multiple images with Glide

a 夏天 提交于 2019-11-27 12:22:57
We are trying to preload images into cache memory to load them later (the images are located in the Asset folder of the application) What we tried: Glide.with(this) .load(pictureUri) .diskCacheStrategy(DiskCacheStrategy.ALL); Glide.with(this) .load(picture_uri) .diskCacheStrategy(DiskCacheStrategy.ALL) .preload(); The issue: Images are cached only when we are trying to load/display them: They have to be loaded in memory before so that they appear faster. Glide.with(this) .load(picture_uri) .into(imageView); We also tried to use a GlideModule to increase the CacheMemory size: public class

Error “You must not call setTag() on a view Glide is targeting” when use Glide

馋奶兔 提交于 2019-11-27 11:29:34
问题 I use Glide library inner custom adapter view in my apps. But I have Error : "You must not call setTag() on a view Glide is targeting" This part of my code : @Override public View getView(int position, View view, ViewGroup container) { ViewHolder holder; if (view == null) { holder = new ViewHolder(); view = holder.imageView = new ImageView(context); view.setTag(holder); } else { holder = (ViewHolder) view.getTag(); } holder.imageView.setAdjustViewBounds(true); LinearLayout.LayoutParams vp =