|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bumptech.glide.util.ViewPreloadSizeProvider<T>
T
- The type of the model the size should be provided for.public class ViewPreloadSizeProvider<T>
A ListPreloader.PreloadSizeProvider
that will extract the preload size from a given
View
.
Constructor Summary | |
---|---|
ViewPreloadSizeProvider()
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. |
|
ViewPreloadSizeProvider(View view)
Constructor that will extract the preload size from a given View . |
Method Summary | |
---|---|
int[] |
getPreloadSize(T item,
int adapterPosition,
int itemPosition)
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. |
void |
onSizeReady(int width,
int height)
A callback called on the main thread. |
void |
setView(View view)
Sets the View the size will be extracted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ViewPreloadSizeProvider()
setView(android.view.View)
when a
View is available to registerComponents the dimensions returned by this class.
public ViewPreloadSizeProvider(View view)
View
.
view
- A not null View the size will be extracted from async using an .OnPreDrawListener
Method Detail |
---|
public int[] getPreloadSize(T item, int adapterPosition, int itemPosition)
ListPreloader.PreloadSizeProvider
null
if no size is currently available.
Note - The dimensions returned here must precisely match those of the view in the list.
getPreloadSize
in interface ListPreloader.PreloadSizeProvider<T>
item
- A modelpublic void onSizeReady(int width, int height)
SizeReadyCallback
onSizeReady
in interface SizeReadyCallback
width
- The width in pixels of the target, or Target.SIZE_ORIGINAL
to indicate that we want the
resource at its original width.height
- The height in pixels of the target, or Target.SIZE_ORIGINAL
to indicate that we want the
resource at its original height.public void setView(View view)
View
the size will be extracted.
Note - only the first call to this method will be obeyed, subsequent requests will be ignored.
view
- A not null View the size will be extracted async with an .OnPreDrawListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |