Skip to content
Closed
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
13 changes: 13 additions & 0 deletions android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ cmake_minimum_required(VERSION 3.9.0)

project(rnscreens)

set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
find_library(log-lib log)
if (log-lib)
message(WARNING "HAS loglib") # This message gets printed
else(log-lib)
message(SEND_ERROR "NO loglib")
endif(log-lib)

if(${RNS_NEW_ARCH_ENABLED})
add_library(rnscreens
SHARED
Expand Down Expand Up @@ -47,6 +57,7 @@ if(${RNS_NEW_ARCH_ENABLED})
ReactAndroid::jsi
fbjni::fbjni
android
${log-lib}
)
else()
target_link_libraries(
Expand All @@ -70,11 +81,13 @@ if(${RNS_NEW_ARCH_ENABLED})
ReactAndroid::react_render_observers_events
fbjni::fbjni
android
${log-lib}
)
endif()
else()
target_link_libraries(rnscreens
ReactAndroid::jsi
android
${log-lib}
)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ abstract class FabricEnabledHeaderSubviewViewGroup(
offsetX: Int,
offsetY: Int,
) {
println("==mylog== FabricEnabledHeaderSubviewViewGroup updateSubviewFrameState " + "offsetX: ${offsetX}, offsetY: ${offsetY}, width: ${width}, height: ${height}")
updateState(width, height, offsetX, offsetY)
}

Expand Down Expand Up @@ -66,7 +67,7 @@ abstract class FabricEnabledHeaderSubviewViewGroup(
putDouble("contentOffsetX", offsetXDip.toDouble())
putDouble("contentOffsetY", offsetYDip.toDouble())
}

println("==mylog==" + " FabricEnabledHeaderSubviewViewGroup updateState" + " width: ${realWidth}, height: ${realHeight}" );
mStateWrapper?.updateState(map)
}

Expand Down
10 changes: 10 additions & 0 deletions android/src/main/java/com/swmansion/rnscreens/ScreenContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ open class ScreenContainer(
private var isAttached = false
private var needsUpdate = false
private var isLayoutEnqueued = false
private var prevLayoutLol: String = "ewf"
private val layoutCallback: ChoreographerCompat.FrameCallback =
object : ChoreographerCompat.FrameCallback() {
override fun doFrame(frameTimeNanos: Long) {
Expand All @@ -38,6 +39,11 @@ open class ScreenContainer(
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY),
)

var curr_layout_vals = "l: ${left}, r: ${right}, t: ${top}, b: ${bottom}"

println("==mylog== doFrame before " + "l: ${left}, r: ${right}, t: ${top}, b: ${bottom} " + "prev: " + prevLayoutLol);

layout(left, top, right, bottom)
}
}
Expand All @@ -50,9 +56,13 @@ open class ScreenContainer(
r: Int,
b: Int,
) {
println("==mylog==" + " ScreenContainer onLayout" + " changed: ${changed} r: ${r} l: ${l} t: ${t} b: ${b}" );

var i = 0
val size = childCount
while (i < size) {
println( "==mylog== ScreenContainer onLayout child:" + getChildAt(i).toString() )

getChildAt(i).layout(0, 0, width, height)
i++
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ class ScreenStackFragment :
ScreensCoordinatorLayoutPointerEventsImpl(),
)

override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
println("==mylog==" + " ScreensCoordinatorLayout onLayout" + " changed: ${changed} r: ${r} l: ${l} t: ${t} b: ${b}" );
super.onLayout(changed, l, t, r, b)
}
override fun onApplyWindowInsets(insets: WindowInsets?): WindowInsets = super.onApplyWindowInsets(insets)

private val animationListener: Animation.AnimationListener =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class ScreenStackHeaderSubview(
r: Int,
b: Int,
) {
if (l==r) {
println("==mylog==")
}
println("==mylog==" + " ScreenStackHeaderSubview onLayout" + " changed: ${changed} r: ${r} l: ${l} t: ${t} b: ${b}" );
if (changed && BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
val width = r - l
val height = b - t
Expand Down
3 changes: 3 additions & 0 deletions android/src/main/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(LIB_COMMON_DIR ${LIB_ANDROID_DIR}/../common/cpp)
set(LIB_COMMON_COMPONENTS_DIR ${LIB_COMMON_DIR}/react/renderer/components/${LIB_LITERAL})
set(LIB_ANDROID_GENERATED_JNI_DIR ${LIB_ANDROID_DIR}/build/generated/source/codegen/jni)
set(LIB_ANDROID_GENERATED_COMPONENTS_DIR ${LIB_ANDROID_GENERATED_JNI_DIR}/react/renderer/components/${LIB_LITERAL})
find_library(log-lib log)

add_compile_options(
-fexceptions
Expand Down Expand Up @@ -45,6 +46,7 @@ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
ReactAndroid::reactnative
ReactAndroid::jsi
fbjni::fbjni
${log-lib}
)
else()
target_link_libraries(
Expand All @@ -65,6 +67,7 @@ else()
rrc_view
turbomodulejsijni
yoga
${log-lib}
)
endif()

Expand Down
Loading