Skip to content

Commit

Permalink
Remove hasDynamicItemHeight
Browse files Browse the repository at this point in the history
Summary: This config, `RecyclerBinderConfig::hasDynamicItemHeight`, has been replaced by `RecyclerBinderConfig::CrossAxisWrapMode`, removing from codebase.

Reviewed By: zielinskimz

Differential Revision: D67032770

fbshipit-source-id: b1d9d2d72ebec2bf13a0f18db49661f15576a9d9
  • Loading branch information
Andrew Wang authored and facebook-github-bot committed Dec 11, 2024
1 parent c391c73 commit e92921a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -806,15 +806,13 @@ private RecyclerBinder(Builder builder) {
mIsCircular = mRecyclerBinderConfig.isCircular;
mHasDynamicItemHeight =
mLayoutInfo.getScrollDirection() == HORIZONTAL
? (mRecyclerBinderConfig.hasDynamicItemHeight
|| mRecyclerBinderConfig.crossAxisWrapMode == CrossAxisWrapMode.Dynamic)
: false;
&& (mRecyclerBinderConfig.crossAxisWrapMode == CrossAxisWrapMode.Dynamic);
mComponentTreeMeasureListenerFactory =
!mHasDynamicItemHeight
? null
: new ComponentTreeMeasureListenerFactory() {
@Override
public @Nullable MeasureListener create(final ComponentTreeHolder holder) {
public MeasureListener create(final ComponentTreeHolder holder) {
return getMeasureListener(holder);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,6 @@ data class RecyclerBinderConfig(
* case, use with caution.
*/
@JvmField val estimatedViewportCount: Int? = null,
/**
* Do not enable this. This is an experimental feature and your Section surface will take a perf
* hit if you use it.
*
* <p>Whether the items of this RecyclerBinder can change height after the initial measure. Only
* applicable to horizontally scrolling RecyclerBinders. If true, the children of this h-scroll
* are all measured with unspecified height. When the ComponentTree of a child is remeasured,
* this will cause the RecyclerBinder to remeasure in case the height of the child changed and
* the RecyclerView needs to have a different height to account for it. This only supports
* changing the height of the item that triggered the remeasuring, not the height of all items
* in the h-scroll.
*/
@JvmField val hasDynamicItemHeight: Boolean = false,
/**
* The [RecyclerBinder] will use this [LayoutHandlerFactory] when creating
* [com.facebook.litho.ComponentTree] in order to specify on which thread layout calculation
Expand Down Expand Up @@ -202,7 +189,6 @@ class RecyclerBinderConfigBuilder internal constructor(configuration: RecyclerBi
private var requestMountForPrefetchedItems = configuration.requestMountForPrefetchedItems
private var recyclerViewItemPrefetch = configuration.recyclerViewItemPrefetch
private var itemViewCacheSize = configuration.itemViewCacheSize
private var hasDynamicItemHeight = configuration.hasDynamicItemHeight
private var componentsConfiguration = configuration.componentsConfiguration
private var rangeRatio = configuration.rangeRatio
private var layoutHandlerFactory = configuration.layoutHandlerFactory
Expand Down Expand Up @@ -243,10 +229,6 @@ class RecyclerBinderConfigBuilder internal constructor(configuration: RecyclerBi
this.componentWarmer = componentWarmer
}

fun hasDynamicItemHeight(hasDynamicItemHeight: Boolean): RecyclerBinderConfigBuilder = also {
this.hasDynamicItemHeight = hasDynamicItemHeight
}

fun crossAxisWrapMode(crossAxisWrapMode: CrossAxisWrapMode): RecyclerBinderConfigBuilder = also {
this.crossAxisWrapMode = crossAxisWrapMode
}
Expand Down Expand Up @@ -286,7 +268,6 @@ class RecyclerBinderConfigBuilder internal constructor(configuration: RecyclerBi
itemViewCacheSize = itemViewCacheSize,
componentWarmer = componentWarmer,
estimatedViewportCount = estimatedViewportCount,
hasDynamicItemHeight = hasDynamicItemHeight,
rangeRatio = rangeRatio,
layoutHandlerFactory = layoutHandlerFactory,
enableStableIds = enableStableIds,
Expand Down

0 comments on commit e92921a

Please sign in to comment.