mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
Introducing RCTRootShadowView.baseDirection property
Reviewed By: dshahidehpour Differential Revision: D4555904 fbshipit-source-id: 8f0a2a9a38af42334188bc1cc5e0f6dded8592ae
This commit is contained in:
parent
a86559ffb5
commit
5263699f90
@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#import <React/RCTShadowView.h>
|
||||
#import <yoga/YGEnums.h>
|
||||
|
||||
@interface RCTRootShadowView : RCTShadowView
|
||||
|
||||
@ -17,6 +18,13 @@
|
||||
*/
|
||||
@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility;
|
||||
|
||||
/**
|
||||
* Layout direction (LTR or RTL) inherited from native environment and
|
||||
* is using as a base direction value in layout engine.
|
||||
* Defaults to value inferred from current locale.
|
||||
*/
|
||||
@property (nonatomic, assign) YGDirection baseDirection;
|
||||
|
||||
/**
|
||||
* Calculate all views whose frame needs updating after layout has been calculated.
|
||||
* Returns a set contains the shadowviews that need updating.
|
||||
|
@ -21,7 +21,7 @@
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.direction = [[RCTI18nUtil sharedInstance] isRTL] ? YGDirectionRTL : YGDirectionLTR;
|
||||
_baseDirection = [[RCTI18nUtil sharedInstance] isRTL] ? YGDirectionRTL : YGDirectionLTR;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@ -48,7 +48,7 @@
|
||||
{
|
||||
[self applySizeConstraints];
|
||||
|
||||
YGNodeCalculateLayout(self.cssNode, YGUndefined, YGUndefined, YGDirectionInherit);
|
||||
YGNodeCalculateLayout(self.cssNode, YGUndefined, YGUndefined, _baseDirection);
|
||||
|
||||
NSMutableSet<RCTShadowView *> *viewsWithNewFrame = [NSMutableSet set];
|
||||
[self applyLayoutNode:self.cssNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero];
|
||||
|
Loading…
x
Reference in New Issue
Block a user