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:
parent
88c6e7a22b
commit
7eadd8c408
|
@ -7,10 +7,26 @@
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import "RCTI18nUtil.h"
|
||||||
#import "RCTRootShadowView.h"
|
#import "RCTRootShadowView.h"
|
||||||
|
|
||||||
@implementation RCTRootShadowView
|
@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
|
- (void)applySizeConstraints
|
||||||
{
|
{
|
||||||
switch (_sizeFlexibility) {
|
switch (_sizeFlexibility) {
|
||||||
|
|
Loading…
Reference in New Issue