Skip to content

Commit 9101ebd

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: More clang-format
Summary: Apparently, I haven't modify all files in D14018903. Here is the last (I hope) chunk. Reviewed By: JoshuaGross Differential Revision: D14058288 fbshipit-source-id: b21950cdd1aa9aa55b0c72fac0f8b44e4a7d131c
1 parent 6b21109 commit 9101ebd

22 files changed

+202
-235
lines changed

React/Fabric/Mounting/ComponentViews/ActivityIndicator/RCTActivityIndicatorViewComponentView.mm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77

88
#import "RCTActivityIndicatorViewComponentView.h"
99

10-
#import <react/components/activityindicator/ActivityIndicatorViewShadowNode.h>
1110
#import <react/components/activityindicator/ActivityIndicatorViewProps.h>
11+
#import <react/components/activityindicator/ActivityIndicatorViewShadowNode.h>
1212

1313
using namespace facebook::react;
1414

15-
static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const ActivityIndicatorViewSize &size) {
15+
static UIActivityIndicatorViewStyle convertActivityIndicatorViewStyle(const ActivityIndicatorViewSize &size)
16+
{
1617
switch (size) {
1718
case ActivityIndicatorViewSize::Small:
1819
return UIActivityIndicatorViewStyleWhite;

React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
#import "RCTViewComponentView.h"
98
#import <React/RCTImageResponseDelegate.h>
9+
#import "RCTViewComponentView.h"
1010

1111
NS_ASSUME_NONNULL_BEGIN
1212

React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77

88
#import "RCTImageComponentView.h"
99

10+
#import <React/RCTImageResponseObserverProxy.h>
1011
#import <react/components/image/ImageEventEmitter.h>
1112
#import <react/components/image/ImageLocalData.h>
1213
#import <react/components/image/ImageProps.h>
1314
#import <react/components/image/ImageShadowNode.h>
1415
#import <react/imagemanager/ImageRequest.h>
1516
#import <react/imagemanager/RCTImagePrimitivesConversions.h>
16-
#import <React/RCTImageResponseObserverProxy.h>
1717

18-
#import "RCTConversions.h"
1918
#import "MainQueueExecutor.h"
19+
#import "RCTConversions.h"
2020

2121
@implementation RCTImageComponentView {
2222
UIImageView *_imageView;
@@ -35,7 +35,7 @@ - (instancetype)initWithFrame:(CGRect)frame
3535
_imageView.clipsToBounds = YES;
3636

3737
_imageView.contentMode = (UIViewContentMode)RCTResizeModeFromImageResizeMode(defaultProps->resizeMode);
38-
38+
3939
_imageResponseObserverProxy = std::make_unique<RCTImageResponseObserverProxy>((__bridge void *)self);
4040

4141
self.contentView = _imageView;
@@ -75,24 +75,24 @@ - (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps
7575
}
7676
}
7777

78-
- (void)updateLocalData:(SharedLocalData)localData
79-
oldLocalData:(SharedLocalData)oldLocalData
78+
- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData
8079
{
8180
SharedImageLocalData previousData = _imageLocalData;
8281
_imageLocalData = std::static_pointer_cast<const ImageLocalData>(localData);
8382
assert(_imageLocalData);
8483
bool havePreviousData = previousData != nullptr;
85-
84+
8685
if (!havePreviousData || _imageLocalData->getImageSource() != previousData->getImageSource()) {
8786
self.coordinator = _imageLocalData->getImageRequest().getObserverCoordinator();
88-
87+
8988
// Loading actually starts a little before this, but this is the first time we know
9089
// the image is loading and can fire an event from this component
9190
std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onLoadStart();
9291
}
9392
}
9493

95-
- (void)setCoordinator:(const ImageResponseObserverCoordinator *)coordinator {
94+
- (void)setCoordinator:(const ImageResponseObserverCoordinator *)coordinator
95+
{
9696
if (_coordinator) {
9797
_coordinator->removeObserver(_imageResponseObserverProxy.get());
9898
}
@@ -110,15 +110,15 @@ - (void)prepareForRecycle
110110
_imageLocalData.reset();
111111
}
112112

113-
-(void)dealloc
113+
- (void)dealloc
114114
{
115115
self.coordinator = nullptr;
116116
_imageResponseObserverProxy.reset();
117117
}
118118

119119
#pragma mark - RCTImageResponseDelegate
120120

121-
- (void)didReceiveImage:(UIImage *)image fromObserver:(void*)observer
121+
- (void)didReceiveImage:(UIImage *)image fromObserver:(void *)observer
122122
{
123123
std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onLoad();
124124

@@ -138,21 +138,22 @@ - (void)didReceiveImage:(UIImage *)image fromObserver:(void*)observer
138138
}
139139

140140
self->_imageView.image = image;
141-
141+
142142
// Apply trilinear filtering to smooth out mis-sized images.
143143
self->_imageView.layer.minificationFilter = kCAFilterTrilinear;
144144
self->_imageView.layer.magnificationFilter = kCAFilterTrilinear;
145145

146146
std::static_pointer_cast<const ImageEventEmitter>(self->_eventEmitter)->onLoadEnd();
147147
}
148148

149-
- (void)didReceiveProgress:(float)progress fromObserver:(void*)observer {
149+
- (void)didReceiveProgress:(float)progress fromObserver:(void *)observer
150+
{
150151
std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onProgress(progress);
151152
}
152153

153-
- (void)didReceiveFailureFromObserver:(void*)observer {
154+
- (void)didReceiveFailureFromObserver:(void *)observer
155+
{
154156
std::static_pointer_cast<const ImageEventEmitter>(_eventEmitter)->onError();
155157
}
156158

157-
158159
@end

React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
#import "RCTRootComponentView.h"
99

10-
#import <react/components/root/RootShadowNode.h>
1110
#import <react/components/root/RootProps.h>
11+
#import <react/components/root/RootShadowNode.h>
1212

1313
using namespace facebook::react;
1414

React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
#import "RCTScrollViewComponentView.h"
99

1010
#import <React/RCTAssert.h>
11-
#import <react/components/scrollview/ScrollViewShadowNode.h>
11+
#import <react/components/scrollview/ScrollViewEventEmitter.h>
1212
#import <react/components/scrollview/ScrollViewLocalData.h>
1313
#import <react/components/scrollview/ScrollViewProps.h>
14-
#import <react/components/scrollview/ScrollViewEventEmitter.h>
14+
#import <react/components/scrollview/ScrollViewShadowNode.h>
1515
#import <react/graphics/Geometry.h>
1616

1717
#import "RCTConversions.h"
@@ -63,9 +63,9 @@ - (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps
6363

6464
[super updateProps:props oldProps:oldProps];
6565

66-
#define REMAP_PROP(reactName, localName, target) \
66+
#define REMAP_PROP(reactName, localName, target) \
6767
if (oldScrollViewProps.reactName != newScrollViewProps.reactName) { \
68-
target.localName = newScrollViewProps.reactName; \
68+
target.localName = newScrollViewProps.reactName; \
6969
}
7070

7171
#define REMAP_VIEW_PROP(reactName, localName) REMAP_PROP(reactName, localName, self)
@@ -80,11 +80,11 @@ - (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps
8080
MAP_SCROLL_VIEW_PROP(bouncesZoom);
8181
MAP_SCROLL_VIEW_PROP(canCancelContentTouches);
8282
MAP_SCROLL_VIEW_PROP(centerContent);
83-
//MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets);
83+
// MAP_SCROLL_VIEW_PROP(automaticallyAdjustContentInsets);
8484
MAP_SCROLL_VIEW_PROP(decelerationRate);
8585
MAP_SCROLL_VIEW_PROP(directionalLockEnabled);
86-
//MAP_SCROLL_VIEW_PROP(indicatorStyle);
87-
//MAP_SCROLL_VIEW_PROP(keyboardDismissMode);
86+
// MAP_SCROLL_VIEW_PROP(indicatorStyle);
87+
// MAP_SCROLL_VIEW_PROP(keyboardDismissMode);
8888
MAP_SCROLL_VIEW_PROP(maximumZoomScale);
8989
MAP_SCROLL_VIEW_PROP(minimumZoomScale);
9090
MAP_SCROLL_VIEW_PROP(scrollEnabled);
@@ -95,30 +95,27 @@ - (void)updateProps:(SharedProps)props oldProps:(SharedProps)oldProps
9595
MAP_SCROLL_VIEW_PROP(showsVerticalScrollIndicator);
9696
MAP_VIEW_PROP(scrollEventThrottle);
9797
MAP_SCROLL_VIEW_PROP(zoomScale);
98-
//MAP_SCROLL_VIEW_PROP(contentInset);
99-
//MAP_SCROLL_VIEW_PROP(scrollIndicatorInsets);
100-
//MAP_SCROLL_VIEW_PROP(snapToInterval);
101-
//MAP_SCROLL_VIEW_PROP(snapToAlignment);
98+
// MAP_SCROLL_VIEW_PROP(contentInset);
99+
// MAP_SCROLL_VIEW_PROP(scrollIndicatorInsets);
100+
// MAP_SCROLL_VIEW_PROP(snapToInterval);
101+
// MAP_SCROLL_VIEW_PROP(snapToAlignment);
102102
}
103103

104-
- (void)updateLocalData:(SharedLocalData)localData
105-
oldLocalData:(SharedLocalData)oldLocalData
104+
- (void)updateLocalData:(SharedLocalData)localData oldLocalData:(SharedLocalData)oldLocalData
106105
{
107106
assert(std::dynamic_pointer_cast<const ScrollViewLocalData>(localData));
108107
_scrollViewLocalData = std::static_pointer_cast<const ScrollViewLocalData>(localData);
109108
CGSize contentSize = RCTCGSizeFromSize(_scrollViewLocalData->getContentSize());
110-
_contentView.frame = CGRect {CGPointZero, contentSize};
109+
_contentView.frame = CGRect{CGPointZero, contentSize};
111110
_scrollView.contentSize = contentSize;
112111
}
113112

114-
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView
115-
index:(NSInteger)index
113+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
116114
{
117115
[_contentView insertSubview:childComponentView atIndex:index];
118116
}
119117

120-
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView
121-
index:(NSInteger)index
118+
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
122119
{
123120
RCTAssert(childComponentView.superview == _contentView, @"Attempt to unmount improperly mounted component view.");
124121
[childComponentView removeFromSuperview];
@@ -152,14 +149,17 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
152149
std::static_pointer_cast<const ScrollViewEventEmitter>(_eventEmitter)->onScrollBeginDrag([self _scrollViewMetrics]);
153150
}
154151

155-
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
152+
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
153+
withVelocity:(CGPoint)velocity
154+
targetContentOffset:(inout CGPoint *)targetContentOffset
156155
{
157156
std::static_pointer_cast<const ScrollViewEventEmitter>(_eventEmitter)->onScrollEndDrag([self _scrollViewMetrics]);
158157
}
159158

160159
- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView
161160
{
162-
std::static_pointer_cast<const ScrollViewEventEmitter>(_eventEmitter)->onMomentumScrollBegin([self _scrollViewMetrics]);
161+
std::static_pointer_cast<const ScrollViewEventEmitter>(_eventEmitter)
162+
->onMomentumScrollBegin([self _scrollViewMetrics]);
163163
}
164164

165165
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

0 commit comments

Comments
 (0)