Create a module for React Native to get IsRTL info and set ForceRTL 2/2

Summary: This diff build the connection between the native code and js code so that the js could get IsRTL value and us ForceRTL function.

Reviewed By: fkgozali

Differential Revision: D3447013

fbshipit-source-id: 9f6c7f71cef0add7bd5beb0ba2b1543f0cabc2b3
This commit is contained in:
Mengjue Wang 2016-06-21 11:51:49 -07:00 committed by Facebook Github Bot 4
parent 88c6e7a22b
commit 7eadd8c408
1 changed files with 16 additions and 0 deletions

View File

@ -7,10 +7,26 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "RCTI18nUtil.h"
#import "RCTRootShadowView.h"
@implementation RCTRootShadowView
/**
* Init the RCTRootShadowView with RTL status.
* Returns a RTL CSS layout if isRTL is true (Default is LTR CSS layout).
*/
- (instancetype)init
{
self = [super init];
if (self) {
if ([[RCTI18nUtil sharedInstance] isRTL]) {
self.cssNode->style.direction = CSS_DIRECTION_RTL;
}
}
return self;
}
- (void)applySizeConstraints
{
switch (_sizeFlexibility) {