Skip to content

Commit 3e30ca3

Browse files
committed
TOREVERT: debugging setup
1 parent 4eb5379 commit 3e30ca3

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

common/cpp/react/renderer/components/rnscreens/RNSScreenStackHeaderSubviewComponentDescriptor.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ class RNSScreenStackHeaderSubviewComponentDescriptor final
3535
shadowNode.getState());
3636
auto stateData = state->getData();
3737

38+
std::printf(
39+
"SubviewCD [%d] adopt frameSize {%.2lf, %.2lf}\n",
40+
shadowNode.getTag(),
41+
stateData.frameSize.width,
42+
stateData.frameSize.height);
43+
44+
// Po zmianie rozmiaru kontentu, shadow node jest klonowany i ustawiany jest
45+
// tutaj stan z poprzedniego shadow node'a (możliwe, że też ostatni
46+
// zamontowany), który był obliczony dla poprzedniego rozmiaru kontentu.
47+
// Strona natywna, nic nie zmieni, bo Yoga wylayoutuje ten subview tak, żeby
48+
// się zmieścił w tej ograniczonej przestrzeni. Bądź tu mądry. Jak to teraz
49+
// naprawić? Wydaje się, że potrzebujemy w ST znać zarówno rozmiar jak i
50+
// content offset, żeby działały pressable. Natomiast jeżeli wymusimy
51+
// rozmiar SN, to nie będziemy wstanie zareagować na zmiany rozmiaru
52+
// zrobione nie ze strony natywnej, a z JSa...
3853
if (!isSizeEmpty(stateData.frameSize)) {
3954
layoutableShadowNode.setSize(stateData.frameSize);
4055
}

ios/RNSScreenStackHeaderSubview.mm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ - (void)layoutNavigationBar
5858
// TODO: It is possible, that this needs to be called only on old architecture.
5959
// Make sure that Test432 keeps working.
6060
[toLayoutView setNeedsLayout];
61+
// [self setNeedsLayout];
6162

6263
// TODO: Determine why this must be called & deferring layout to next "update cycle"
6364
// is not sufficient. See Test2552 and Test432. (Talking Paper here).
@@ -106,6 +107,7 @@ - (void)updateProps:(react::Props::Shared const &)props oldProps:(react::Props::
106107
}
107108

108109
RNS_IGNORE_SUPER_CALL_BEGIN
110+
109111
// System layouts the subviews.
110112
- (void)updateLayoutMetrics:(const react::LayoutMetrics &)layoutMetrics
111113
oldLayoutMetrics:(const react::LayoutMetrics &)oldLayoutMetrics
@@ -122,12 +124,26 @@ - (void)updateLayoutMetrics:(const react::LayoutMetrics &)layoutMetrics
122124
NSStringFromCGRect(frame),
123125
self);
124126
} else {
127+
NSLog(@"Subview [%ld] updateLayoutMetrics %@", self.tag, NSStringFromCGRect(CGRect{CGPointZero, frame.size}));
125128
self.bounds = CGRect{CGPointZero, frame.size};
126129
[self layoutNavigationBar];
127130
}
128131
}
132+
129133
RNS_IGNORE_SUPER_CALL_BEGIN
130134

135+
- (void)setFrame:(CGRect)frame
136+
{
137+
NSLog(@"Subview [%ld] setFrame %@", self.tag, NSStringFromCGRect(frame));
138+
[super setFrame:frame];
139+
}
140+
141+
- (void)setBounds:(CGRect)bounds
142+
{
143+
NSLog(@"Subview [%ld] setBounds %@", self.tag, NSStringFromCGRect(bounds));
144+
[super setBounds:bounds];
145+
}
146+
131147
+ (BOOL)shouldBeRecycled
132148
{
133149
return NO;

0 commit comments

Comments
 (0)