- Notifications
You must be signed in to change notification settings - Fork374
Custom ViewTarget
Yauheni Pakala edited this pageJan 2, 2020 ·1 revision
Example add a custom target for the custom view.
SubsamplingScaleImageView - A custom image view for Android, designed for photo galleries and displaying huge images.
usingFFImageLoading.Drawables;usingFFImageLoading.Targets;usingFFImageLoading.Work;namespaceFFDroidTargetDemo{usingCom.Davemorrissey.Labs.Subscaleview;publicclassSubsamplingScaleImageViewTarget:ViewTarget<SubsamplingScaleImageView>{publicSubsamplingScaleImageViewTarget(SubsamplingScaleImageViewimageView):base(imageView){}publicoverridevoidSet(IImageLoaderTasktask,SelfDisposingBitmapDrawableimage,boolanimated){varsource=ImageSource.ForBitmap(image.Bitmap);Control.SetImage(source);}}}
vartarget=newSubsamplingScaleImageViewTarget(_imageView);ImageService.Instance.LoadUrl("image-url").IntoAsync(target);