-
- All Implemented Interfaces:
-
com.airbnb.epoxy.CarouselModelBuilder,com.airbnb.epoxy.GeneratedModel
public class CarouselModel_ extends EpoxyModel<Carousel> implements GeneratedModel<Carousel>, CarouselModelBuilder
Generated file. Do not modify!
-
-
Method Summary
Modifier and Type Method Description voidaddTo(EpoxyController controller)Add this model to the given controller. CarouselbuildView(ViewGroup parent)Create and return a new instance of a view for this model. voidhandlePreBind(EpoxyViewHolder holder, Carousel object, int position)Called on the generated model immediately before the main model onBind method has been called. voidbind(Carousel object)Binds the current data to the given view. voidbind(Carousel object, EpoxyModel previousModel)Similar to bind, but provides a non null model which was previously bound tothis view. voidhandlePostBind(Carousel object, int position)Called on the generated model immediately after the main model onBind method has been called.This let's the generated model handle binding of its own and dispatch calls to its onBindlistener. CarouselModel_onBind(OnModelBoundListener<CarouselModel_, Carousel> listener)Register a listener that will be called when this model is bound to a view. voidunbind(Carousel object)Called when the view bound to this model is recycled. CarouselModel_onUnbind(OnModelUnboundListener<CarouselModel_, Carousel> listener)Register a listener that will be called when this model is unbound from a view. voidonVisibilityStateChanged(int visibilityState, Carousel object)TODO link to the wiki CarouselModel_onVisibilityStateChanged(OnModelVisibilityStateChangedListener<CarouselModel_, Carousel> listener)Register a listener that will be called when this model visibility state has changed. voidonVisibilityChanged(float percentVisibleHeight, float percentVisibleWidth, int visibleHeight, int visibleWidth, Carousel object)TODO link to the wiki CarouselModel_onVisibilityChanged(OnModelVisibilityChangedListener<CarouselModel_, Carousel> listener)Register a listener that will be called when this model visibility has changed. CarouselModel_hasFixedSize(boolean hasFixedSize)Optional: Default value is false booleanhasFixedSize()CarouselModel_numViewsToShowOnScreen(float numViewsToShowOnScreen)Set the number of views to show on screen in this carousel at a time, partial numbers areallowed. floatnumViewsToShowOnScreenFloat()CarouselModel_initialPrefetchItemCount(int initialPrefetchItemCount)If you are using a Linear or Grid layout manager you can use this to set the item prefetchcount. intinitialPrefetchItemCountInt()CarouselModel_paddingRes(@DimenRes() int paddingRes)Set a dimension resource to specify the padding value to use on each side of the carousel andin between carousel items. intpaddingResInt()CarouselModel_paddingDp(@Dimension(unit = 0) int paddingDp)Set a DP value to use as the padding on each side of the carousel and in between carouselitems. intpaddingDpInt()CarouselModel_padding(@Nullable() Carousel.Padding padding)Use the Padding class to specify individual padding values for each side of thecarousel, as well as item spacing. Carousel.PaddingpaddingPadding()CarouselModel_models(@NonNull() List<out EpoxyModel<out Object>> models)Required. List<out EpoxyModel<out Object>>models()CarouselModel_id(long id)Override the default id in cases where the data subject naturally has an id, like an objectfrom a database. CarouselModel_id(@Nullable() Array<Number> ids)Use multiple numbers as the id for this model. CarouselModel_id(long id1, long id2)Use two numbers as the id for this model. CarouselModel_id(@Nullable() CharSequence key)Use a string as the model id. CarouselModel_id(@Nullable() CharSequence key, @Nullable() Array<CharSequence> otherKeys)Use several strings to define the id of the model. CarouselModel_id(@Nullable() CharSequence key, long id)Set an id that is namespaced with a string. CarouselModel_layout(@LayoutRes() int layoutRes)CarouselModel_spanSizeOverride(@Nullable() EpoxyModel.SpanSizeOverrideCallback spanSizeCallback)CarouselModel_show()Change the visibility of the model so that it's view is shown. CarouselModel_show(boolean show)Change the visibility of the model's view. CarouselModel_hide()Change the visibility of the model so that it's view is hidden. CarouselModel_reset()Sets fields of the model to default ones. booleanequals(Object o)inthashCode()StringtoString()booleanshouldSaveViewState()Whether the adapter should save the state of the view bound to this model. intgetSpanSize(int totalSpanCount, int position, int itemCount)Subclasses can override this if they want their view to take up more than one span in a gridlayout. -
Methods inherited from class com.airbnb.epoxy.EpoxyModel
addIf, addIf, addTo, bind, bind, bind, buildView, getLayout, hide, id, id, id, id, id, id, id, isShown, layout, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onVisibilityChanged, onVisibilityStateChanged, preBind, reset, show, show, spanSize, spanSizeOverride, unbind -
Methods inherited from class com.airbnb.epoxy.GeneratedModel
handlePostBind, handlePreBind -
Methods inherited from class com.airbnb.epoxy.CarouselModelBuilder
hasFixedSize, id, id, id, id, id, id, initialPrefetchItemCount, models, numViewsToShowOnScreen, onBind, onUnbind, onVisibilityChanged, onVisibilityStateChanged, padding, paddingDp, paddingRes, spanSizeOverride -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
addTo
void addTo(EpoxyController controller)
Add this model to the given controller. Can only be called from inside .
-
buildView
Carousel buildView(ViewGroup parent)
Create and return a new instance of a view for this model. By default a view is created byinflating the layout resource.
-
handlePreBind
void handlePreBind(EpoxyViewHolder holder, Carousel object, int position)
Called on the generated model immediately before the main model onBind method has been called.This let's the generated model handle binding setup of its own
The ViewHolder is needed to get the model's adapter position when clicked.
-
bind
void bind(Carousel object)
Binds the current data to the given view. You should bind all fields including unset/emptyfields to ensure proper recycling.
-
bind
void bind(Carousel object, EpoxyModel previousModel)
Similar to bind, but provides a non null model which was previously bound tothis view. This will only be called if the model is used with an EpoxyController.
-
handlePostBind
void handlePostBind(Carousel object, int position)
Called on the generated model immediately after the main model onBind method has been called.This let's the generated model handle binding of its own and dispatch calls to its onBindlistener.
We don't want to rely on the main onBind method to dispatch the onBind listener call becausethere are two onBind methods (one for payloads and one for no payloads), and one can call intothe other. We don't want to dispatch two onBind listener calls in that case.
-
onBind
CarouselModel_ onBind(OnModelBoundListener<CarouselModel_, Carousel> listener)
Register a listener that will be called when this model is bound to a view.
The listener will contribute to this model's hashCode state per the rules.
You may clear the listener by setting a null value, or by calling reset
-
unbind
void unbind(Carousel object)
Called when the view bound to this model is recycled. Subclasses can override this if theirview should release resources when it's recycled.
Note that bind can be called multiple times without an unbind call in betweenif the view has remained on screen to be reused across item changes. This means that you shouldnot rely on unbind to clear a view or model's state before bind is called again.
-
onUnbind
CarouselModel_ onUnbind(OnModelUnboundListener<CarouselModel_, Carousel> listener)
Register a listener that will be called when this model is unbound from a view.
The listener will contribute to this model's hashCode state per the rules.
You may clear the listener by setting a null value, or by calling reset
-
onVisibilityStateChanged
void onVisibilityStateChanged(int visibilityState, Carousel object)
TODO link to the wiki
-
onVisibilityStateChanged
CarouselModel_ onVisibilityStateChanged(OnModelVisibilityStateChangedListener<CarouselModel_, Carousel> listener)
Register a listener that will be called when this model visibility state has changed.
The listener will contribute to this model's hashCode state per the rules.
-
onVisibilityChanged
void onVisibilityChanged(float percentVisibleHeight, float percentVisibleWidth, int visibleHeight, int visibleWidth, Carousel object)
TODO link to the wiki
-
onVisibilityChanged
CarouselModel_ onVisibilityChanged(OnModelVisibilityChangedListener<CarouselModel_, Carousel> listener)
Register a listener that will be called when this model visibility has changed.
The listener will contribute to this model's hashCode state per the rules.
-
hasFixedSize
CarouselModel_ hasFixedSize(boolean hasFixedSize)
Optional: Default value is false
-
hasFixedSize
boolean hasFixedSize()
-
numViewsToShowOnScreen
CarouselModel_ numViewsToShowOnScreen(float numViewsToShowOnScreen)
Set the number of views to show on screen in this carousel at a time, partial numbers areallowed.
This is useful where you want to easily control for the number of items on screen,regardless of screen size. For example, you could set this to 1.2f so that one view is shown infull and 20% of the next view "peeks" from the edge to indicate that there is more content toscroll to.
Another pattern is setting a different view count depending on whether the device is phoneor tablet.
Additionally, if a LinearLayoutManager is used this value will be forwarded to as a performance optimization.
If you want to only change the prefetch count without changing the view size you can simplyuse setInitialPrefetchItemCount
Optional: Default value is 0.0f
-
numViewsToShowOnScreenFloat
float numViewsToShowOnScreenFloat()
-
initialPrefetchItemCount
CarouselModel_ initialPrefetchItemCount(int initialPrefetchItemCount)
If you are using a Linear or Grid layout manager you can use this to set the item prefetchcount. Only use this if you are not using setNumViewsToShowOnScreen
-
initialPrefetchItemCountInt
int initialPrefetchItemCountInt()
-
paddingRes
CarouselModel_ paddingRes(@DimenRes() int paddingRes)
Set a dimension resource to specify the padding value to use on each side of the carousel andin between carousel items.
Optional: Default value is 0
-
paddingResInt
@DimenRes() int paddingResInt()
-
paddingDp
CarouselModel_ paddingDp(@Dimension(unit = 0) int paddingDp)
Set a DP value to use as the padding on each side of the carousel and in between carouselitems.
The default as the value returned by getDefaultSpacingBetweenItemsDp
Optional: Default value is {@value Carousel#NO_VALUE_SET}
-
paddingDpInt
@Dimension(unit = 0) int paddingDpInt()
-
padding
CarouselModel_ padding(@Nullable() Carousel.Padding padding)
Use the Padding class to specify individual padding values for each side of thecarousel, as well as item spacing.
A value of null will set all padding and item spacing to 0.
Optional: Default value is (Carousel.Padding) null
-
paddingPadding
@Nullable() Carousel.Padding paddingPadding()
-
models
CarouselModel_ models(@NonNull() List<out EpoxyModel<out Object>> models)
Required.
-
models
@NonNull() List<out EpoxyModel<out Object>> models()
-
id
CarouselModel_ id(long id)
Override the default id in cases where the data subject naturally has an id, like an objectfrom a database. This id can only be set before the model is added to the adapter, it is anerror to change the id after that.
-
id
CarouselModel_ id(@Nullable() Array<Number> ids)
Use multiple numbers as the id for this model. Useful when you don't have a single long thatrepresents a unique id.
This hashes the numbers, so there is a tiny risk of collision with other ids.
-
id
CarouselModel_ id(long id1, long id2)
Use two numbers as the id for this model. Useful when you don't have a single long thatrepresents a unique id.
This hashes the two numbers, so there is a tiny risk of collision with other ids.
-
id
CarouselModel_ id(@Nullable() CharSequence key)
Use a string as the model id. Useful for models that don't clearly map to a numerical id. Thisis preferable to using hashCode because that is a 32 bit hash and this is a 64bit hash, giving better spread and less chance of collision with other ids.
Since this uses a hashcode method to convert the String to a long there is a very small chancethat you may have a collision with another id. Assuming an even spread of hashcodes, andseveral hundred models in the adapter, there would be roughly 1 in 100 trillion chance of acollision. (http://preshing.com/20110504/hash-collision-probabilities/)
-
id
CarouselModel_ id(@Nullable() CharSequence key, @Nullable() Array<CharSequence> otherKeys)
Use several strings to define the id of the model.
Similar to id, but with additional strings.
-
id
CarouselModel_ id(@Nullable() CharSequence key, long id)
Set an id that is namespaced with a string. This is useful when you need to show models ofmultiple types, side by side and don't want to risk id collisions.
Since this uses a hashcode method to convert the String to a long there is a very small chancethat you may have a collision with another id. Assuming an even spread of hashcodes, andseveral hundred models in the adapter, there would be roughly 1 in 100 trillion chance of acollision. (http://preshing.com/20110504/hash-collision-probabilities/)
-
layout
CarouselModel_ layout(@LayoutRes() int layoutRes)
-
spanSizeOverride
CarouselModel_ spanSizeOverride(@Nullable() EpoxyModel.SpanSizeOverrideCallback spanSizeCallback)
-
show
CarouselModel_ show()
Change the visibility of the model so that it's view is shown. This only works if the model isused in EpoxyAdapter or a EpoxyModelGroup, but is not supported in
-
show
CarouselModel_ show(boolean show)
Change the visibility of the model's view. This only works if the model isused in EpoxyAdapter or a EpoxyModelGroup, but is not supported in
-
hide
CarouselModel_ hide()
Change the visibility of the model so that it's view is hidden. This only works if the model isused in EpoxyAdapter or a EpoxyModelGroup, but is not supported in
-
reset
CarouselModel_ reset()
Sets fields of the model to default ones.
-
hashCode
int hashCode()
-
shouldSaveViewState
boolean shouldSaveViewState()
Whether the adapter should save the state of the view bound to this model.
-
getSpanSize
int getSpanSize(int totalSpanCount, int position, int itemCount)
Subclasses can override this if they want their view to take up more than one span in a gridlayout.
- Parameters:
totalSpanCount- The number of spans in the gridposition- The position of the modelitemCount- The total number of items in the adapter
-
-
-
-