pass flexiblity to shadowrootview on its creation

Reviewed By: javache

Differential Revision: D3177404

fb-gh-sync-id: 2116628461e37e9f1d1b3cbc6d6560675cadee7e
fbshipit-source-id: 2116628461e37e9f1d1b3cbc6d6560675cadee7e
This commit is contained in:
Martin Kralik
2016-04-20 10:52:25 -07:00
committed by Facebook Github Bot 1
parent 5cdfe0f4b1
commit eff673572e
3 changed files with 10 additions and 7 deletions

View File

@@ -13,6 +13,7 @@
#import "RCTBridgeModule.h"
#import "RCTInvalidating.h"
#import "RCTViewManager.h"
#import "RCTRootView.h"
/**
* Posted right before re-render happens. This is a chance for views to invalidate their state so
@@ -47,7 +48,7 @@ RCT_EXTERN NSString *const RCTUIManagerRootViewKey;
/**
* Register a root view with the RCTUIManager.
*/
- (void)registerRootView:(UIView *)rootView;
- (void)registerRootView:(UIView *)rootView withSizeFlexibility:(RCTRootViewSizeFlexibility)sizeFlexibility;
/**
* Gets the view associated with a reactTag.

View File

@@ -26,7 +26,6 @@
#import "RCTModuleData.h"
#import "RCTModuleMethod.h"
#import "RCTProfile.h"
#import "RCTRootView.h"
#import "RCTRootShadowView.h"
#import "RCTRootViewInternal.h"
#import "RCTScrollableProtocol.h"
@@ -336,7 +335,7 @@ RCT_EXPORT_MODULE()
return _shadowQueue;
}
- (void)registerRootView:(UIView *)rootView
- (void)registerRootView:(UIView *)rootView withSizeFlexibility:(RCTRootViewSizeFlexibility)sizeFlexibility
{
RCTAssertMainThread();
@@ -364,6 +363,7 @@ RCT_EXPORT_MODULE()
shadowView.frame = frame;
shadowView.backgroundColor = rootView.backgroundColor;
shadowView.viewName = NSStringFromClass([rootView class]);
shadowView.sizeFlexibility = sizeFlexibility;
strongSelf->_shadowViewRegistry[shadowView.reactTag] = shadowView;
[strongSelf->_rootViewTags addObject:reactTag];
});