Skip to content

Commit

Permalink
Create a module for React Native to get IsRTL info and set ForceRTL 2/2
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MengjueW authored and Morgan Pretty committed Aug 24, 2016
1 parent 00f1f70 commit 4ea87fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions React/Views/RCTRootShadowView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4ea87fd

Please sign in to comment.