OkHttp (Client Asokhttp3.OkHttpClient)
Initialize Glide With OkHttpClient
Retrofit (Amir_Retrofit Asir.aghajari.retrofit.Retrofit, Type AsInt)
Initialize Glide With Retrofit
Type : 0 = CallFactory | 1 = Client
Functions:
ApplyDefaultRequestOptions (Transform AsAmir_GlideRequestOptions) Asir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Updates the default RequestOptions for all loads started with this request manager
with the given RequestOptions.
Multiple sets of options can be applied. If there are conflicts the last
RequestOptions applied will win.
The modified options will only be applied to loads started after this method is called.
Clear (View Asandroid.view.View) Asir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Cancel any pending loads Glide may have for the view and free any resources that may have been
loaded for the view.
Note : that this will only work if View#setTag(Object) is not called on this view
outside of Glide.
param : view The view to cancel loads and free resources for.
throws : IllegalArgumentException if an object other than Glide's metadata is put as the view's tag.
isPausedAsBoolean Returns true if loads for this RequestManager are currently paused.
PauseAllRequestsAsir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Cancels any in progress loads and clears resources of completed loads.
Note : resumeRequests must be called for any requests made before or while the
manager is paused to complete. RequestManagers attached to Fragments and Activities
automatically resume onStart().
This will release the memory used by completed bitmaps but leaves them in any configured caches.
see : isPaused()
see : resumeRequests()
PauseRequestsAsir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Cancels any in progress loads, but does not clear resources of completed loads.
Note : resumeRequests must be called for any requests made before or while the
manager is paused to complete. RequestManagers attached to Fragments and Activities
automatically resume onStart().
PauseRequestsRecursiveAsir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Performs pauseRequests recursively for all managers that are contextually
descendant to this manager based on the Activity/Fragment hierarchy:
ResumeRequestsAsir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Restarts any loads that have not yet completed.
ResumeRequestsRecursiveAsir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Performs resumeRequests recursively for all managers that are contextually
descendant to this manager based on the Activity/Fragment hierarchy. The hierarchical semantics
are identical as for pauseRequestsRecursive.
SetDefaultRequestOptions (requestOptions AsAmir_GlideRequestOptions) Asir.aghajari.retrofitglide.Amir_Glide.Amir_RequestManager Replaces the default RequestOptions for all loads started with this request manager
with the given RequestOptions.
The RequestOptions provided here replace those that have been previously provided
via this method, setDefaultRequestOptions(RequestOptions) and applyDefaultRequestOptions(RequestOptions).
Subsequent calls to applyDefaultRequestOptions(RequestOptions) will not mutate
the RequestOptions provided here. Instead the manager will create a clone of these
options and mutate the clone.
MemoryCategoryAsString [write only]
HIGH | NORMAL | LOW
Adjusts Glide's current and maximum memory usage based on the given MemoryCategory.
The default MemoryCategory is NORMAL.
HIGH increases Glide's maximum memory usage by up to 50% and
LOW decreases Glide's maximum memory usage by 50%. This method should be
used to temporarily increase or decrease memory usage for a single Activity or part of the app.
PhotoCacheDirAsString [read only]
Returns a directory with a default name in the private cache directory of the application to
use to store retrieved media and thumbnails.
TrimMemoryAsInt [write only]
Clears some memory with the exact amount depending on the given level.
Functions:
BitmapAsir.aghajari.retrofitglide.Amir_Glide.Loader Attempts to always load the resource as a android.graphics.Bitmap, even if it could
actually be animated.
DrawableAsir.aghajari.retrofitglide.Amir_Glide.Loader Attempts to always load the resource using any registered {@link
com.bumptech.glide.load.ResourceDecoder}s that can decode any subclass of {@link Drawable}.
By default, may return either a android.graphics.drawable.BitmapDrawable or
GifDrawable, but if additional decoders are registered for other Drawable subclasses,
any of those subclasses may also be returned.
FileAsir.aghajari.retrofitglide.Amir_Glide.Loader Attempts to always load a File containing the resource, either using a file path
obtained from the media store (for local images/videos), or using Glide's disk cache
(for remote images/videos).
GifAsir.aghajari.retrofitglide.Amir_Glide.Loader Attempts to always load the resource as a Amir_GlidGifDrawable
If the underlying data is not a GIF, this will fail. As a result, this should only be used
if the model represents an animated GIF and the caller wants to interact with the GifDrawable
directly. Normally using just asDrawable is sufficient because it will determine
whether or not the given data represents an animated GIF and return the appropriate
Drawable, animated or not, automatically.
New (Class AsClass) Asir.aghajari.retrofitglide.Amir_Glide.Loader
getPreloadSize (item AsObject, adapterPosition AsInt, itemPosition AsInt) AsInt() Returns the size of the view in the list where the resources will be displayed
in pixels in the format [x, y], or null if no size is currently available.
Initialize_FixedSize (ImageWidth AsInt, ImageHeight AsInt)
Constructor for a PreloadSizeProvider with a fixed size.
Initialize_ViewSize Constructor that does nothing by default and requires users to call setView(android.view.View)
when a View is available to registerComponents the dimensions returned by this class.
Initialize_ViewSize2 (View Asandroid.view.View)
Constructor that will extract the preload size from a given View.
SetView (View Asandroid.view.View)
Sets the View the size will be extracted.
Note - only the first call to this method will be obeyed, subsequent requests will be ignored.
Parameters:
View - A not null View the size will be extracted async with an .OnPreDrawListener
This Method Only Work if You Initialize PreloadSizeProvider With ViewSize
Fields:
PreloadSizeProviderAsir.aghajari.retrofitglide.Amir_Glide.Amir_PreloadSizeProvider The PreloadSizeProvider is responsible for making sure your RecyclerViewPreloader
loads images in the same size as those loaded by your adapters onBindViewHolder method.
Glide provides two built in implementations of PreloadSizeProvider: 1. ViewPreloadSizeProvider
2. FixedPreloadSizeProvider
If you have uniform View sizes in your RecyclerView, you’re loading images with
into(ImageView) and you’re not using override() to set a different size, you can
use ViewPreloadSizeProvider.
If you’re using override() or are otherwise loading image sizes that don’t exactly
match the size of your Views, you can use FixedPreloadSizeProvider.
If the logic required to determine the image size used for a given position in your
RecyclerView doesn’t fit either of those cases, you can always write your own
implementation of PreloadSizeProvider.
Functions:
MaxPreload (maxPreload AsInt) Asir.aghajari.retrofitglide.Amir_Glide.RV Maximum number of items to preload.
The maxPreload is an integer that indicates how many items you want to preload.
The optimal number will vary by your image size, quantity, the layout of your
RecyclerView and in some cases even the devices your application is running on.
A good starting point is to pick a number large enough to include all of the images
in two or three rows. Once you’ve picked your initial number, you can try running
your application on a couple of devices and tweaking it as necessary to maximize
the number of cache hits.
An overly large number will mean you’re preloading too far ahead to be useful.
An overly small number will prevent you from loading enough images ahead of time.
Defualt Is 10
PreloadModelProvider (EventName AsString) Asir.aghajari.retrofitglide.Amir_Glide.RV The PreloadModelProvider performs two actions.
First it collects and returns a list of Models (the items you pass in to Glide’s
load(Object) method, like URLs or file paths) for a given position. Second it
takes a Model and produces a Glide RequestBuilder that will be used to preload
the given Model into memory.
Don't Forgot Add This two Events Events
Sub EventName_getPreloadItems (position as int) As List 'Object Lists
Return Null
End Sub
Sub EventName_getPreloadRequestBuilder (arg As Object) As Amir_GlideRequestBuilder
Return Null
End Sub
ResetAsir.aghajari.retrofitglide.Amir_Glide.RV Remove All Data..
Before Run This Method You Can Run RemoveFromRecyclerView Return : New ir.aghajari.retrofitglide.Amir_Glide.RV
SetToRecyclerView (RecyclerView Asandroid.support.v7.widget.RecyclerView)
Constructor that accepts interfaces for providing the dimensions of images to preload,
the list of models to preload for a given position, and the request to use to load images.
The final step, once you have your RecyclerViewPreloader is to add it as a scroll listener to your RecyclerView:
Apply (RequestOptions AsAmir_GlideRequestOptions) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Applies the given options to the request.
ErrorBuilder (Error AsAmir_GlideRequestBuilder) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Sets a RequestBuilder that is built and run iff the load started by this RequestBuilder fails.
If this RequestBuilder uses a thumbnail that succeeds the given error
RequestBuilder will be started anyway if the non-thumbnail request fails.
Recursive calls to this method as well as calls to thumbnail(float) and
thumbnail(RequestBuilder) are supported for the given error RequestBuilder.
Unlike thumbnail(RequestBuilder) and thumbnail(float), no options from
this primary RequestBuilder are propagated to the given error RequestBuilder.
Options like priority, override widths and heights and transitions must be applied
independently to the error builder.
The given RequestBuilder will start and potentially override a fallback drawable
if it's set on this RequestBuilder via
RequestOptions fallback(android.graphics.drawable.Drawable) or
RequestOptions fallback(int).
Into (View Asandroid.widget.ImageView) AsObject Sets the ImageView the resource will be loaded into, cancels any existing loads into
the view, and frees any resources Glide may have previously loaded into the view so they may be
reused.
Listener (EventName AsString, ba AsBA, Sender AsObject) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Sets a RequestListener to monitor the resource load. It's best to create a single
instance of an exception handler per type of request (usually activity/fragment) rather than
pass one in per request to avoid some redundant object allocation.
Thumbnail (sizeMultiplier AsFloat) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Loads a resource in an identical manner to this request except with the dimensions of the
target multiplied by the given size multiplier. If the thumbnail load completes before the full
size load, the thumbnail will be shown. If the thumbnail load completes after the full size
load, the thumbnail will not be shown.
Recursive calls to thumbnail are supported.
ThumbnailRequest (thumbnailRequest AsAmir_GlideRequestBuilder) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Loads and displays the resource retrieved by the given thumbnail request if it finishes before
this request. Best used for loading thumbnail resources that are smaller and will be loaded
more quickly than the full size resource. There are no guarantees about the order in which the
requests will actually finish. However, if the thumb request completes after the full request,
the thumb resource will never replace the full resource.
Recursive calls to thumbnail are supported.
Transition (Transition Asir.aghajari.retrofitglide.Amir_GlideTransitionOptions.Amir_TransitionOptionsAnim) Asir.aghajari.retrofitglide.Amir_RRequestBuilder Sets the TransitionOptions to use to transition from the placeholder or thumbnail when
this load completes.
The given TransitionOptions will replace any TransitionOptions set previously.
Amir_Glide
Legendary Coderslcoders.ir|http://lcoders.ir
Amirhossein Aghajari|http://lcoders.ir/about --> امیر حسین آقاجریGlide Version : 4.7.0 Edited Version : 4.7.1
Retrofit , Glide
hi. Tnx For Select Amir_Glide Library.
The Best Glid Library in Android..
You Can Connect Amir_Glide To The Amir_Retrofit To Get Best Speed !
Fields:
LastRequestAsAmir_GlideRequestBuilder
Functions:
AboutAsString "امیرحسین آقاجری" تهیه کننده :
Telegram Id : @LCoders
Instagram : amirhossein_aghajari_official
AsAsir.aghajari.retrofitglide.Amir_Glide.AsWhat
InitializerAsir.aghajari.retrofitglide.Amir_Glide.Initializer Initialize Glide
Return a new Initializer Class
_____________________________________________________________________ If you do not use Initialize,
the default Context will be ApplicationContext
_____________________________________________________________________ Examples : Dim Glide As Amir_Glide Default :
Glide.Initializer.Default Retrofit : Glide.Initializer.Retrofit(Amir_Retrofit,0) 'CallFactory Glide.Initializer.Retrofit(Amir_Retrofit,1) 'HttpClient OkHttp :
Glide.Initializer.OkHttp(OkHttpClient)
RecyclerViewAsir.aghajari.retrofitglide.Amir_Glide.RV Loads a few resources ahead in the direction of scrolling in any RecyclerView so that
images are in the memory cache just before the corresponding view in created in the list. Gives
the appearance of an infinitely large image cache, depending on scrolling speed, cpu speed, and
cache size.
Must be added as a listener to the RecyclerView using OnScrollListener, or have its
corresponding methods called from another
android.support.v7.widget.RecyclerView.OnScrollListener to function.
This class only works with android.support.v7.widget.LinearLayoutManager and
subclasses of android.support.v7.widget.LinearLayoutManager.
RetrofitLoad (Link AsString) Asir.aghajari.retrofitglide.Amir_RRequestBuilder This is a Custom Method Useing Callback Retrofit To Show Image And Gifs ...
You Can Use This Method Just With Initialize Retrofit
Don't Forgot to Enable Cache In Retrofit Builder
ROAsAmir_GlideRequestOptions [read only]
return a new Amir_GlideRequestOptions class
TOAsAmir_GlideTransitionOptions [read only]
return a new Amir_GlideTransitionOptions class
Amir_GlideGifDrawable
Manage Your Gif ...
Example :
Glide.AsGif.Load("Gif_URL_Link").Listener("Amir",Null).Into(ImageView)
Sub Amir_onResourceReady (Data As Object,Model As Object,DataSourceName As String,isFirstResource as boolean) As Boolean
Dim Gif As Amir_GlidGifDrawable
if Gif.Initialize(Data) Then
Log(Gif.FrameCount)
Gif.LoopCount=1
End if
Return False
End Sub
Fields:
LOOP_FOREVERAsInt A constant indicating that an animated drawable should loop continuously.
BeginAsAmir_GlideRequest Starts an asynchronous load.
ClearAsAmir_GlideRequest Prevents any bitmaps being loaded from previous requests, releases any resources held by this
request, displays the current placeholder if one was provided, and marks the request as having
been cancelled.
ClearOnDetachAsAmir_GlideRequest Clears the View's Request when the View is detached from its
android.view.Window and restarts the Request when the View is
re-attached from its android.view.Window.
This is an experimental API that may be removed in a future version.
Using this method can save memory by allowing Glide to more eagerly clear resources when
transitioning screens or swapping adapters in scrolling views. However it also substantially
increases the odds that images will not be in memory if users subsequently return to a screen
where images were previously loaded. Whether or not this happens will depend on the number
of images loaded in the new screen and the size of the memory cache. Increasing the size of
the memory cache can improve this behavior but it largely negates the memory benefits of using
this method.
Use this method with caution and measure your memory usage to ensure that it's actually
improving your memory usage in the cases you care about.
isCancelledAsBoolean Returns true if the request has been cancelled.
isCompleteAsBoolean Returns true if the request has completed successfully.
isEquivalentTo (Request AsAmir_GlideRequest) AsBoolean Returns true if this Request is equivalent to the given Request (has all of the same
options and sizes).
This method is identical to Object equals(Object) except that it's specific to
Request subclasses. We do not use Object equals(Object) directly because we
track Requests in collections like java.util.Set and it's perfectly legitimate
to have two different Request objects for two different Targets (for example).
Using a similar but different method let's us selectively compare Request objects to each
other when it's useful in specific scenarios.
isFailedAsBoolean Returns true if the request has failed.
isPausedAsBoolean Returns true if this request is paused and may be restarted.
isResourceSetAsBoolean Returns true if a non-placeholder resource is put. For Requests that load more than one
resource, isResourceSet may return true even if isComplete returns false.
isRunningAsBoolean Returns true if this request is running and has not completed or failed.
PauseAsAmir_GlideRequest Identical to clear except that the request may later be restarted.
RecycleAsAmir_GlideRequest Recycles the request object and releases its resources.
WaitForLayoutAsAmir_GlideRequest waitForLayout If set to true, Glide will always wait for any pending layout pass
before checking for the size a View. If set to false Glide will only wait for a pending
layout pass if it's unable to resolve the size from layout parameters or an existing View size.
Because setting this parameter to true forces Glide to wait for the layout pass to
occur before starting the load, setting this parameter to true can cause flashing in
some cases and should be used sparingly. If layout parameters are set to fixed sizes, they will
still be used instead of the View's dimensions even if this parameter is set to true.
This parameter is a fallback only.
Properties:
ViewAsandroid.view.View [read only]
Amir_GlideRequestBuilder
Use Amir_Glide To Get Amir_GlideRequestBuilder
Events:
onLoadFailed (ErrorMessage AsString, Model AsObject, isFirstResource AsBoolean) AsBoolean
onResourceReady (Data AsObject, Model AsObject, DataSourceName AsString, isFirstResource AsBoolean) AsBoolean
Functions:
Apply (RequestOptions AsAmir_GlideRequestOptions) AsAmir_GlideRequestBuilder Applies the given options to the request.
CloneAsAmir_GlideRequestBuilder Returns a copy of this request builder with all of the options put so far on this builder.
This method returns a "deep" copy in that all non-immutable arguments are copied such that
changes to one builder will not affect the other builder. However, in addition to immutable
arguments, the current model is not copied copied so changes to the model will affect both
builders.
ErrorBuilder (Error AsAmir_GlideRequestBuilder) AsAmir_GlideRequestBuilder Sets a RequestBuilder that is built and run iff the load started by this RequestBuilder fails.
If this RequestBuilder uses a thumbnail that succeeds the given error
RequestBuilder will be started anyway if the non-thumbnail request fails.
Recursive calls to this method as well as calls to thumbnail(float) and
thumbnail(RequestBuilder) are supported for the given error RequestBuilder.
Unlike thumbnail(RequestBuilder) and thumbnail(float), no options from
this primary RequestBuilder are propagated to the given error RequestBuilder.
Options like priority, override widths and heights and transitions must be applied
independently to the error builder.
The given RequestBuilder will start and potentially override a fallback drawable
if it's set on this RequestBuilder via
RequestOptions fallback(android.graphics.drawable.Drawable) or
RequestOptions fallback(int).
Into (View Asandroid.widget.ImageView) AsAmir_GlideRequest Sets the ImageView the resource will be loaded into, cancels any existing loads into
the view, and frees any resources Glide may have previously loaded into the view so they may be
reused.
Listener (EventName AsString, ba AsBA, Sender AsObject) AsAmir_GlideRequestBuilder Sets a RequestListener to monitor the resource load. It's best to create a single
instance of an exception handler per type of request (usually activity/fragment) rather than
pass one in per request to avoid some redundant object allocation.
Thumbnail (sizeMultiplier AsFloat) AsAmir_GlideRequestBuilder Loads a resource in an identical manner to this request except with the dimensions of the
target multiplied by the given size multiplier. If the thumbnail load completes before the full
size load, the thumbnail will be shown. If the thumbnail load completes after the full size
load, the thumbnail will not be shown.
Recursive calls to thumbnail are supported.
ThumbnailRequest (thumbnailRequest AsAmir_GlideRequestBuilder) AsAmir_GlideRequestBuilder Loads and displays the resource retrieved by the given thumbnail request if it finishes before
this request. Best used for loading thumbnail resources that are smaller and will be loaded
more quickly than the full size resource. There are no guarantees about the order in which the
requests will actually finish. However, if the thumb request completes after the full request,
the thumb resource will never replace the full resource.
Recursive calls to thumbnail are supported.
Transition (Transition Asir.aghajari.retrofitglide.Amir_GlideTransitionOptions.Amir_TransitionOptionsAnim) AsAmir_GlideRequestBuilder Sets the TransitionOptions to use to transition from the placeholder or thumbnail when
this load completes.
The given TransitionOptions will replace any TransitionOptions set previously.
Amir_GlideRequestOptions
Provides type independent options to customize loads with Glide.
Fields:
TRAsAmir_GlideTransformation a Fild To Get Amir_GlideTransformation
Functions:
Apply (other AsAmir_GlideRequestOptions) AsAmir_GlideRequestOptions Updates this options set with any options that are explicitly set in the given
RequestOptions object and returns this object if autoClone() is disabled or
a new RequestOptions object if autoClone() is enabled.
apply only replaces those values that are explicitly set in the given RequestOptions.
If you need to completely reset all previously set options, create a
new RequestOptions object instead of using this method.
The options that will be set to values in the returned RequestOptions object is the
intersection of the set of options in this RequestOptions object and the given
RequestOptions object that were explicitly set. If the values of any of the options
conflict, the values in the returned RequestOptions object will be set to those in the
given RequestOptions object.
AutoCloneAsAmir_GlideRequestOptions Similar to lock() except that mutations cause a clone() operation to happen
before the mutation resulting in all methods returning a new Object and leaving the original
locked object unmodified.
Auto clone is not retained by cloned objects returned from mutations. The cloned objects
are mutable and are not locked.
CenterCropAsAmir_GlideRequestOptions Applies CenterCrop to all default types and
throws an exception if asked to transform an unknown type.
this will override previous calls to dontTransform().
CenterInsideAsAmir_GlideRequestOptions Applies CenterInside to all default types, DownsampleStrategy CENTER_INSIDE to
image types and throws an exception if asked to transform an unknown type.
This will override previous calls to dontTransform() and previous calls to
Downsample(DownsampleStrategy).
CircleCropAsAmir_GlideRequestOptions Applies CircleCrop to all default types and throws an exception if asked to transform
an unknown type.
This will override previous calls to DontTransform().
CloneAsAmir_GlideRequestOptions Returns a copy of this request builder with all of the options put so far on this builder.
This method returns a "deep" copy in that all non-immutable arguments are copied such that
changes to one builder will not affect the other builder. However, in addition to immutable
arguments, the current model is not copied copied so changes to the model will affect both
builders.
Even if this object was locked, the cloned object returned from this method will not be
locked.
DisallowHardwareConfigAsAmir_GlideRequestOptions Disables the use of android.graphics.Bitmap.Config HARDWARE in Downsampler to
avoid errors caused by inspecting Bitmap pixels, drawing with hardware support disabled,
drawing to android.graphics.Canvass backed by Bitmaps etc.
It's almost never safe to set Downsampler ALLOW_HARDWARE_CONFIG to true so
we only provide a way to disable hardware configs entirely. If no option is set for
Downsampler ALLOW_HARDWARE_CONFIG, Glide will set the value per request based on
whether or not a Transformation is applied and if one is, the type of
Transformation applied. Built in transformations like FitCenter and
DownsampleStrategy.CenterOutside can safely use
android.graphics.Bitmap.Config HARDWARE because they can be entirely replaced by
scaling within Downsampler. Transformations like CircleCrop that
can't be replicated by Downsampler cannot use Bitmap.Config HARDWARE because
android.graphics.Bitmap.Config HARDWARE cannot be drawn to
android.graphics.Canvass, which is required by most Transformations.
DiskCacheStrategy (Type AsString) AsAmir_GlideRequestOptions Sets the DiskCacheStrategy to use for this load.
Defaults to AUTOMATIC.
For most applications RESOURCE is ideal.
Applications that use the same resource multiple times in multiple sizes and are willing
to trade off some speed and disk space in return for lower bandwidth usage may want to consider
using DATA or ALL.
___________________________________________ Types : "ALL" "AUTOMATIC" "DATA" "NONE" "RESOURCE"
DontAnimateAsAmir_GlideRequestOptions Disables resource decoders that return animated resources so any resource returned will be
static.
DontTransformAsAmir_GlideRequestOptions Removes all applied Transformation Transformations for all resource classes and allows
unknown resource types to be transformed without throwing an exception.
DownsampleStrategy (Type AsString) AsAmir_GlideRequestOptions Sets the DownsampleStrategy to use when decoding Bitmaps using Downsampler.
This is a component option specific to Downsampler. If the defautlt Bitmap decoder
is replaced or skipped because of your configuration, this option may be ignored.
EncodeFormat (Type AsString) AsAmir_GlideRequestOptions Sets the value for key BitmapEncoder COMPRESSION_FORMAT.
_______________________________________________________ Types : "JPEG" "WEBP" "PNG"
ErrorDrawable (errorDrawable Asandroid.graphics.drawable.Drawable) AsAmir_GlideRequestOptions Sets a Drawable to display if a load fails.
FallBack (drawable Asandroid.graphics.drawable.Drawable) AsAmir_GlideRequestOptions Sets an Drawable to display if the model provided to RequestBuilder Load(Object) is Null.
If a fallback is not set, null models will cause the error drawable to be displayed. If the
error drawable is not set, the placeholder will be displayed.
FitCenterAsAmir_GlideRequestOptions Applies FitCenter and to all default types, DownsampleStrategy FIT_CENTER to
image types, and throws an exception if asked to transform an unknown
type.
This will override previous calls to DontTransform() and previous calls to
Downsample(DownsampleStrategy).
Format (Type AsString) AsAmir_GlideRequestOptions Sets the DecodeFormat to use when decoding Bitmap objects using
Downsampler and Glide's default GIF decoders.
DecodeFormat is a request, not a requirement. It's possible the resource will be
decoded using a decoder that cannot control the format
(android.media.MediaMetadataRetriever for example), or that the decoder may choose to
ignore the requested format if it can't display the image (i.e. RGB_565 is requested, but the
image has alpha).
This is a component option specific to Downsampler and Glide's GIF decoders. If the
default Bitmap decoders are replaced or skipped because of your configuration, this option may
be ignored.
To set only the format used when decoding Bitmaps, use
option and Downsampler DECODE_FORMAT. To set only the format
used when decoding GIF frames, use option and
GifOptions DECODE_FORMAT.
_______________________________________________________ Types : "DEFAULT" "PREFER_ARGB_8888" "PREFER_ARGB_8888_DISALLOW_HARDWARE" "PREFER_RGB_565"
Frame (frameTimeMicros AsLong) AsAmir_GlideRequestOptions Sets the time position of the frame to extract from a video.
This is a component option specific to VideoDecoder. If the default video
decoder is replaced or skipped because of your configuration, this option may be ignored.
frameTimeMicros :
The time position in microseconds of the desired frame. If negative the Android
framework implementation return a representative frame.
LockAsAmir_GlideRequestOptions Throws if any further mutations are attempted.
Once locked, the only way to unlock is to use clone()
OnlyRetrieveFromCache (flag AsBoolean) AsAmir_GlideRequestOptions If set to true, will only load an item if found in the cache, and will not fetch from source.
OptionalCenterCropAsAmir_GlideRequestOptions Applies CenterCrop to all default types, and ignores unknown types.
This will override previous calls to DontTransform().
OptionalCenterInsideAsAmir_GlideRequestOptions Applies CenterInside to all default types, DownsampleStrategy CENTER_INSIDE
to image types, and ignores unknown types.
This will override previous calls to DontTransform() and previous calls to
Downsample(DownsampleStrategy).
OptionalCircleCropAsAmir_GlideRequestOptions Applies CircleCrop to all default types, and ignores unknown types.
This will override previous calls to dontTransform().
OptionalFitCenterAsAmir_GlideRequestOptions Applies FitCenter and to all default types, DownsampleStrategy FIT_CENTER to
image types, and ignores unknown types.
This will override previous calls to DontTransform() and previous calls to
Downsample(DownsampleStrategy).
OptionalTransform (Transition AsAmir_GlideTransformation) AsAmir_GlideRequestOptions Applies the given Transformation for Bitmaps to the default types (Bitmap),
android.graphics.drawable.BitmapDrawable, and GifDrawable and ignores unknown types.
This will override previous calls to DontTransform().
Support Multi Transformation :)
Override (size AsInt) AsAmir_GlideRequestOptions Overrides the Target's width and height with the given size.
Override2 (width AsInt, height AsInt) AsAmir_GlideRequestOptions Overrides the Target's width and height with the
given values. This is useful for thumbnails, and should only be used for other cases when you
need a very specific image size.
Placeholder (placeholder Asandroid.graphics.drawable.Drawable) AsAmir_GlideRequestOptions Sets an Drawable to display while a resource is loading.
Priority (Type AsString) AsAmir_GlideRequestOptions Sets the priority for this load. Types : "IMMEDIATE" "HIGH" "NORMAL" "LOW"
Quality (quality AsInt) AsAmir_GlideRequestOptions Sets the value for key BitmapEncoder COMPRESSION_QUALITY from 0 to 100
Signature (ObjectKey AsObject) AsAmir_GlideRequestOptions Sets some additional data to be mixed in to the memory and disk cache keys allowing the caller
more control over when cached data is invalidated.
Note - The signature does not replace the cache key, it is purely additive.
SizeMultiplier (sizeMultiplier AsFloat) AsAmir_GlideRequestOptions Applies a multiplier to the Target's size before
loading the resource. Useful for loading thumbnails or trying to avoid loading huge resources
(particularly Bitmaps on devices with overly dense screens.
SkipMemoryCache (skipMemoryCache AsBoolean) AsAmir_GlideRequestOptions Allows the loaded resource to skip the memory cache.
Note : this is not a guarantee. If a request is already pending for this resource and that
request is not also skipping the memory cache, the resource will be cached in memory.
Theme (theme Asandroid.content.res.Resources.Theme) AsAmir_GlideRequestOptions Sets the android.content.res.Resources.Theme to apply when loading Drawables
for resource ids provided via Error,Placeholder, and Fallback.
The theme is NOT applied in the decoder that will attempt to decode a given
resource id model on Glide's background threads. The theme is used exclusively on the main
thread to obtain placeholder/error/fallback drawables to avoid leaking Activities.
If the android.content.Context of the android.app.Fragment or
android.app.Activity used to start this load has a different
android.content.res.Resources.Theme, the android.content.res.Resources.Theme
provided here will override the android.content.res.Resources.Theme of the
android.content.Context.
theme : The theme to use when loading Drawables.
TimeOut (timeout AsInt) AsAmir_GlideRequestOptions Sets the read and write timeout for the http requests used to load the image.
Transform (Transition AsAmir_GlideTransformation) AsAmir_GlideRequestOptions Applies the given Transformation for any decoded resource of
the given type and throws if asked to transform an unknown resource type.
This will override previous calls to DontTransform().
Support Multi Transformation :)
UseAnimationPool (flag AsBoolean) AsAmir_GlideRequestOptions If set to true, uses a special java.util.concurrent.Executor that is used
exclusively for decoding frames of animated resources, like GIFs.
The animation executor disallows network operations and must not be used for loads that
may load remote data. The animation executor has fewer threads available to it than Glide's
normal executors and is only useful as a way of avoiding blocking on longer and more expensive
reads for critical requests like those in an animating GIF.
If both useUnlimitedSourceGeneratorsPool(boolean) and this method are set,
useUnlimitedSourceGeneratorsPool(boolean) will be preferred and this method will be
ignored.
UseUnlimitedSourceGeneratorsPool (flag AsBoolean) AsAmir_GlideRequestOptions If set to true, uses a cached unlimited java.util.concurrent.Executor to run
the request.
This method should ONLY be used when a Glide load is started recursively on one
of Glide's threads as part of another request. Using this method in other scenarios can lead
to excessive memory usage and OOMs and/or a significant decrease in performance across an
application.
If both this method and useAnimationPool(boolean) are set, this method will be
preferred and useAnimationPool(boolean) will be ignored.
Amir_GlideTransformation
Some Transformations To Use In Request..
There is a List For Add Multi Transformation
CreateTransform (EventName AsString, DiskCacheKey AsString, Sender AsObject) AsAmir_GlideTransformation EventName_Transform (BitmapToTransform As Object,outWidth as int,outHeight As int) As Bitmap
Crop (width AsInt, height AsInt, CropTypes AsString) AsAmir_GlideTransformation TOP CENTER BOTTOM
Mask (maskId AsInt) AsAmir_GlideTransformation Set a Mask drawable Example :
Dim Xml As XmlLayoutBuilder
Dim Request As Amir_GlideRequestOptions
Dim Trans As Amir_GlideTransformation
Request.BitmapTransition(Trans.Mask(Xml.GetResourceId("drawable","mask_image")))
Glide.Load("Link") _
.Apply(Request).Into(img)
MaskDrawable (drawable Asandroid.graphics.drawable.Drawable) AsAmir_GlideTransformation Set a Mask drawable Example :
Dim drawable As BitmapDrawable
drawable.Initialize(LoadBitmap(File.DirAssets,"images.png"))
Dim Request As Amir_GlideRequestOptions
Dim Trans As Amir_GlideTransformation
Request.BitmapTransition(Trans.MaskDrawable(drawable))
Glide.Load("Link") _
.Apply(Request).Into(img)
Tint (Color AsInt) AsAmir_GlideTransformation You Can Change The All Of BitmapColor With ColorFilter
Amir_GlideTransitionOptions
Implementation of TransitionOptions that exposes only generic methods that can be applied
to any resource type.
Functions:
Animator (EventName AsString, Sender AsObject) Asir.aghajari.retrofitglide.Amir_GlideTransitionOptions.Amir_TransitionOptionsAnim Returns a typed GenericTransitionOptions object that uses the given animator. Don't Forgot To Add Event
Event : EventName_onAnimate (View As Object)
NoTransitionAsir.aghajari.retrofitglide.Amir_GlideTransitionOptions.Amir_TransitionOptionsAnim Removes any existing animation put on the builder.
ViewAnimationId (viewAnimationId AsInt) Asir.aghajari.retrofitglide.Amir_GlideTransitionOptions.Amir_TransitionOptionsAnim Returns a typed GenericTransitionOptions object that uses the given view animation.