diff --git a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt index 087e63d8..e97d5ad8 100644 --- a/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt +++ b/dpadrecyclerview/src/main/java/com/rubensousa/dpadrecyclerview/DpadRecyclerView.kt @@ -71,7 +71,7 @@ open class DpadRecyclerView @JvmOverloads constructor( private var isOverlappingRenderingEnabled = true private var isRetainingFocus = false private var startedTouchScroll = false - private var enableLayoutChangesWhileScrolling = true + private var layoutWhileScrollingEnabled = true private var hasPendingLayout = false private var touchInterceptListener: OnTouchInterceptListener? = null private var smoothScrollByBehavior: SmoothScrollByBehavior? = null @@ -229,7 +229,7 @@ open class DpadRecyclerView @JvmOverloads constructor( } final override fun requestLayout() { - if (enableLayoutChangesWhileScrolling || scrollState == SCROLL_STATE_IDLE) { + if (layoutWhileScrollingEnabled || scrollState == SCROLL_STATE_IDLE) { hasPendingLayout = false super.requestLayout() return @@ -1254,8 +1254,8 @@ open class DpadRecyclerView @JvmOverloads constructor( * or false if they should be postponed until [RecyclerView.SCROLL_STATE_IDLE]. * Default is true. */ - fun enableLayoutChangesWhileScrolling(enabled: Boolean) { - enableLayoutChangesWhileScrolling = enabled + fun setLayoutWhileScrollingEnabled(enabled: Boolean) { + layoutWhileScrollingEnabled = enabled } @VisibleForTesting diff --git a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/compose/NestedComposeListViewHolder.kt b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/compose/NestedComposeListViewHolder.kt index e95a2f28..498c22d3 100644 --- a/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/compose/NestedComposeListViewHolder.kt +++ b/sample/src/main/java/com/rubensousa/dpadrecyclerview/sample/ui/screen/compose/NestedComposeListViewHolder.kt @@ -42,7 +42,7 @@ class NestedComposeListViewHolder( recyclerView.setRecycledViewPool(viewPool) // Compose animations trigger a full layout-pass, // so disable layout changes while scrolling - recyclerView.enableLayoutChangesWhileScrolling(false) + recyclerView.setLayoutWhileScrollingEnabled(false) recyclerView.addItemDecoration( DpadLinearSpacingDecoration.create( itemSpacing = itemView.resources.getDimensionPixelOffset(