android-glide

GlideApp not found using LibraryGlideModule (Glide 4)

独自空忆成欢 提交于 2019-11-28 14:29:46
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. What am I doing wrong? In your Android Studio: - Click menu Build - Clik Make Module And GlideApp Class

Glide listener doesn't work

半城伤御伤魂 提交于 2019-11-28 11:52:34
I'm using Glide to load images and I added a listener to know when resource is ready or if there was an error of any type: Glide.with(mContext) .load(url) .placeholder(R.drawable.glide_placeholder) // use dontAnimate and not crossFade to avoid a bug with custom views .dontAnimate() .diskCacheStrategy(DiskCacheStrategy.ALL) .listener(new RequestListener<String, GlideDrawable>() { @Override public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) { // do something return true; } @Override public boolean onResourceReady(GlideDrawable resource,

Glide - load single frame from video at specific time?

核能气质少年 提交于 2019-11-28 11:06:34
I'm trying to use Glide to step through frames in a video file (without running into the keyframe seeking issue that Android suffers from). I can do this in Picasso by doing something like: picasso = new Picasso.Builder(MainActivity.this).addRequestHandler(new PicassoVideoFrameRequestHandler()).build(); picasso.load("videoframe://" + Environment.getExternalStorageDirectory().toString() + "/source.mp4#" + frameNumber) .placeholder(drawable) .memoryPolicy(MemoryPolicy.NO_CACHE) .into(imageView); (frameNumber is simply an int which increases by 50000 microseconds each time). I also have a

Set visibility of progress bar gone on completion of image loading using Glide library

只谈情不闲聊 提交于 2019-11-28 04:15:56
Hi I want to have a progress bar for image which will shown while image loading but when image loading will be completed I want to set it to gone. Earlier I was using Picasso library for this. But I don't know how to use it with Glide library. I have idea that some resource ready function is there but I don't know how to use it. Can anyone help me? Code for Picasso Library Picasso.with(mcontext).load(imgLinkArray.get(position).mUrlLink) .into(imageView, new Callback() { @Override public void onSuccess() { progressBar.setVisibility(View.GONE); } @Override public void onError() { } }) ; Now How

Progress bar while loading image using Glide

心已入冬 提交于 2019-11-28 02:58:49
Can I load a spinner in placeholder with rotating animation until the image is loaded using Glide? I am trying to do that using .placeholder(R.Drawable.spinner) no animation is coming up? It would be great if somebody could help me out? Thanks! Edit: This is super simple now with the CircularProgressDrawable released in 26.1.0 (Support library): MyGlideModule.kt @GlideModule class MyGlideModule : AppGlideModule() MainActivity.kt override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val circularProgressDrawable =

Android Glide library not working with shared element transitions

感情迁移 提交于 2019-11-28 02:57:41
问题 I'm looking to adopt the Glide library in place of Universal Image Loader but I'm running into a problem with regards to shared element transitions. In my simple Sandbox I've created the following transition using UIL: https://dl.dropboxusercontent.com/u/97787025/device-2015-06-18-113333.mp4 Pretty simple, and it works fine. But when I used Glide, it doesn't look so nice: https://dl.dropboxusercontent.com/u/97787025/device-2015-06-18-114508.mp4 Here is the code I'm using The first activity:

Glide cannot resolve asBitmap()

帅比萌擦擦* 提交于 2019-11-28 02:48:26
问题 Why I can't resolve this method while using Glide also I can't resolve .diskstaretegy() : Glide.with(getActivity()) .load(chalet.profilePhoto) .asBitmap() <--- cannot resolve this .diskCacheStrategy(DiskCacheStrategy.ALL) <--- cannot reslove this .fitCenter() .placeholder(R.drawable.logo).dontAnimate().into(mImageView); My gradle :- compile 'com.github.bumptech.glide:glide:4.0.0' 回答1: I found the way to fix it, you must add the asBitmap() right After with() and it will work just like old

Using Firebase Storage image with Glide

五迷三道 提交于 2019-11-27 23:52:41
There are tons of duplicated answers I had tried almost all of them but I am still not able to use Firebase storage image with Glide. First of all I am using docs FirebaseStorage storage = FirebaseStorage.getInstance(); StorageReference storageRef = storage.getReference(); StorageReference pathReference = storageRef.child("sorular/1.jpg"); // ImageView in your Activity ImageView imageView = rootView.findViewById(R.id.imageView); // Load the image using Glide Glide.with(this /* context */) .using(new FirebaseImageLoader()) // Cannot resolve method 'using .load(pathReference) .into(imageView);

Resize images with Glide in a ImageView Android

[亡魂溺海] 提交于 2019-11-27 23:49:11
问题 I have a lot of doubts about the treatment of the images in android, and I was hoping to see if you could solve them. At this point I have an image that occupies 320 dp high, and match_parent width, which is around 60% of the screen. This image of the load with Glide, of some images in 1080 that I have personally. I tried to make centroCrop and fitXY, but always deform the images. The first type I know cuts the image, but the second one fits a size, but it does deform the image high or wide.

Using Glide to load bitmap into ImageView

这一生的挚爱 提交于 2019-11-27 20:15:00
How can i use Glide library to load Bitmap into my ImageView? I want to create a custom image with text and load it into imageview using Glide. This is my method to create custom bitmap with text public Bitmap imageWithText(String text) { TextView tv = new TextView(context); tv.setText(text); tv.setTextColor(Color.WHITE); tv.setBackgroundColor(Color.BLACK); tv.setTypeface(null, Typeface.BOLD); tv.setGravity(Gravity.CENTER); tv.setTextSize(20); tv.setPadding(0, 25, 0, 0); Bitmap testB = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(testB); tv.layout(0, 0, 100,