Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion android/src/main/java/com/sheet2/AppFittedSheet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,17 @@ open class AppFittedSheet(context: Context) :
}

override fun getChildCount(): Int =
if (useInlinePresentation) 0 else reactChildCount()

override fun getChildAt(index: Int): View? =
if (useInlinePresentation) null else reactChildAt(index)

internal fun reactChildCount(): Int =
mHostView.childCount +
(if (inlineOverlayView != null) 1 else 0) +
(if (dialogOverlayView != null) 1 else 0)

override fun getChildAt(index: Int): View? {
internal fun reactChildAt(index: Int): View? {
if (index < mHostView.childCount) return mHostView.getChildAt(index)
val overlayIndex = index - mHostView.childCount
if (inlineOverlayView != null && overlayIndex == 0) return inlineOverlayView
Expand Down
11 changes: 10 additions & 1 deletion android/src/main/java/com/sheet2/Sheet2ViewManager.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sheet2

import android.graphics.Color
import android.view.View
import com.behavior.BottomSheetBehavior
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.module.annotations.ReactModule
Expand Down Expand Up @@ -77,7 +78,7 @@ class Sheet2ViewManager(reactContext: ReactApplicationContext) : ViewGroupManage
override fun setPassScrollViewReactTag(view: Sheet2View, value: String?) {
println("==========setPassScrollViewReactTag $value")
value ?: return
val v = BottomSheetBehavior.findView(view) ?: return
val v = BottomSheetBehavior.findView(view.mHostView) ?: return
view.setNewNestedScrollView(v)
}

Expand Down Expand Up @@ -118,6 +119,14 @@ class Sheet2ViewManager(reactContext: ReactApplicationContext) : ViewGroupManage
view.mHostView.setVirtualHeight(value.dpToPx())
}

override fun getChildCount(parent: Sheet2View): Int {
return parent.reactChildCount()
}

override fun getChildAt(parent: Sheet2View, index: Int): View? {
return parent.reactChildAt(index)
}

override fun onDropViewInstance(view: Sheet2View) {
super.onDropViewInstance(view)
view.onDropInstance()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"example"
],
"private": "true",
"version": "7.12.0",
"version": "7.12.1",
"description": "Native implementation of Bottom sheet",
"main": "src/index.tsx",
"module": "src/index",
Expand Down
Loading