@@ -2,6 +2,7 @@ package com.lodev09.truesheet.core
2
2
3
3
import android.annotation.SuppressLint
4
4
import android.content.Context
5
+ import android.util.Log
5
6
import android.view.MotionEvent
6
7
import android.view.View
7
8
import com.facebook.react.config.ReactFeatureFlags
@@ -30,6 +31,8 @@ class RootSheetView(private val context: Context?) :
30
31
private var viewWidth = 0
31
32
private var viewHeight = 0
32
33
34
+ private var hasUpdatedSize = false
35
+
33
36
private val jSTouchDispatcher = JSTouchDispatcher (this )
34
37
private var jSPointerDispatcher: JSPointerDispatcher ? = null
35
38
var sizeChangeListener: ((w: Int , h: Int ) -> Unit )? = null
@@ -45,22 +48,13 @@ class RootSheetView(private val context: Context?) :
45
48
private val reactContext: ThemedReactContext
46
49
get() = context as ThemedReactContext
47
50
48
- private fun updateContainerSize () {
49
- sizeChangeListener?.let { it(viewWidth, viewHeight) }
50
- }
51
-
52
51
override fun onSizeChanged (w : Int , h : Int , oldw : Int , oldh : Int ) {
53
52
super .onSizeChanged(w, h, oldw, oldh)
54
53
55
54
viewWidth = w
56
55
viewHeight = h
57
56
58
- updateContainerSize()
59
- }
60
-
61
- override fun addView (child : View , index : Int , params : LayoutParams ) {
62
- super .addView(child, index, params)
63
- updateContainerSize()
57
+ sizeChangeListener?.let { it(viewWidth, viewHeight) }
64
58
}
65
59
66
60
override fun handleException (t : Throwable ) {
0 commit comments