From e92921a9f525bbbd2e68794e96c81f1ec40ad91d Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Wed, 11 Dec 2024 02:43:46 -0800 Subject: [PATCH] Remove `hasDynamicItemHeight` Summary: This config, `RecyclerBinderConfig::hasDynamicItemHeight`, has been replaced by `RecyclerBinderConfig::CrossAxisWrapMode`, removing from codebase. Reviewed By: zielinskimz Differential Revision: D67032770 fbshipit-source-id: b1d9d2d72ebec2bf13a0f18db49661f15576a9d9 --- .../facebook/litho/widget/RecyclerBinder.java | 6 ++---- .../litho/widget/RecyclerBinderConfig.kt | 19 ------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java index 3dc4211585..33ac34403d 100644 --- a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java +++ b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinder.java @@ -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); } }; diff --git a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinderConfig.kt b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinderConfig.kt index 0151e1bc99..c490b20cff 100644 --- a/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinderConfig.kt +++ b/litho-widget/src/main/java/com/facebook/litho/widget/RecyclerBinderConfig.kt @@ -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. - * - *

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 @@ -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 @@ -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 } @@ -286,7 +268,6 @@ class RecyclerBinderConfigBuilder internal constructor(configuration: RecyclerBi itemViewCacheSize = itemViewCacheSize, componentWarmer = componentWarmer, estimatedViewportCount = estimatedViewportCount, - hasDynamicItemHeight = hasDynamicItemHeight, rangeRatio = rangeRatio, layoutHandlerFactory = layoutHandlerFactory, enableStableIds = enableStableIds,