Skip to content

Commit a131f8a

Browse files
committed
KeyboardInput - rename some more protocols \ interfaces to avoid duplication
1 parent 4a1662e commit a131f8a

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
@import UIKit;
1010

11-
@protocol LNAnimation <NSObject>
11+
@protocol LNAnimationTemp <NSObject>
1212

1313
@property (nonatomic) CGFloat progress;
1414

1515
@end
1616

17-
@interface LNViewAnimation : NSObject <LNAnimation>
17+
@interface LNViewAnimationTemp : NSObject <LNAnimationTemp>
1818

1919
@property (nonatomic, strong, readonly) UIView* view;
2020
@property (nonatomic, strong, readonly) NSString* keyPath;
@@ -27,9 +27,9 @@
2727
@interface LNAnimatorTemp : NSObject
2828

2929
@property (nonatomic, readonly) NSTimeInterval duration;
30-
@property (nonatomic, strong, readonly) NSArray<id<LNAnimation>>* animations;
30+
@property (nonatomic, strong, readonly) NSArray<id<LNAnimationTemp>>* animations;
3131

32-
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimation>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler;
32+
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimationTemp>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler;
3333

3434
- (void)start;
3535

lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#import "LNInterpolation.h"
1212

13-
@implementation LNViewAnimation
13+
@implementation LNViewAnimationTemp
1414
{
1515
id _fromValue;
1616
}
@@ -19,7 +19,7 @@ @implementation LNViewAnimation
1919

2020
- (instancetype)init
2121
{
22-
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimation objects."];
22+
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimationTemp objects."];
2323
return nil;
2424
}
2525

@@ -30,7 +30,7 @@ - (instancetype)_init
3030

3131
+ (instancetype)animationWithView:(UIView*)view keyPath:(NSString*)keyPath toValue:(id)toValue
3232
{
33-
LNViewAnimation* rv = [[LNViewAnimation alloc] _init];
33+
LNViewAnimationTemp* rv = [[LNViewAnimationTemp alloc] _init];
3434

3535
if(rv)
3636
{
@@ -62,7 +62,7 @@ @implementation LNAnimatorTemp
6262

6363
- (instancetype)init
6464
{
65-
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimation objects."];
65+
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimationTemp objects."];
6666
return nil;
6767
}
6868

@@ -71,7 +71,7 @@ - (instancetype)_init
7171
return [super init];
7272
}
7373

74-
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimation>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler
74+
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimationTemp>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler
7575
{
7676
LNAnimatorTemp* rv = [[LNAnimatorTemp alloc] _init];
7777
if(rv)
@@ -102,7 +102,7 @@ - (void)_displayLinkDidTick
102102
}
103103
_previousFrameTimestamp = _displayLink.timestamp;
104104

105-
[_animations enumerateObjectsUsingBlock:^(id<LNAnimation> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
105+
[_animations enumerateObjectsUsingBlock:^(id<LNAnimationTemp> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
106106
obj.progress = MIN(_elapsedTime / _duration, 1.0);
107107
}];
108108

lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515

1616
#define kHlperViewTag 0x1f1f1f
1717

18-
NSString *const RCTCustomInputControllerKeyboardResigendEvent = @"kbdResigned";
18+
NSString *const RCTCustomInputControllerKeyboardResigendEventTemp = @"kbdResigned";
1919

20-
@protocol _WXInputHelperViewDelegate <NSObject>
20+
@protocol _WXInputHelperViewDelegateTemp <NSObject>
2121
-(void)_WXInputHelperViewResignFirstResponder:(UIView*)wxInputHelperView;
2222
@end
2323

24-
@interface _WXInputHelperView : UIView
24+
@interface _WXInputHelperViewTemp : UIView
2525

2626
@property (nullable, nonatomic, readwrite, strong) UIInputViewController *inputViewController;
27-
@property (nonatomic, weak) id<_WXInputHelperViewDelegate> delegate;
27+
@property (nonatomic, weak) id<_WXInputHelperViewDelegateTemp> delegate;
2828
@property (nullable, readwrite, strong) UIView *inputAccessoryView;
2929
@property (nonatomic) BOOL keepInSuperviewOnResign;
3030

3131
@end
3232

33-
@implementation _WXInputHelperView
33+
@implementation _WXInputHelperViewTemp
3434

3535
- (BOOL)canBecomeFirstResponder
3636
{
@@ -58,7 +58,7 @@ - (BOOL)resignFirstResponder
5858
@end
5959

6060

61-
@interface RCTCustomInputControllerTemp () <_WXInputHelperViewDelegate> {
61+
@interface RCTCustomInputControllerTemp () <_WXInputHelperViewDelegateTemp> {
6262
UIWindow *_fullScreenWindow;
6363
BOOL _performingExpandTransition;
6464
}
@@ -81,7 +81,7 @@ - (dispatch_queue_t)methodQueue
8181

8282
- (NSArray<NSString *> *)supportedEvents
8383
{
84-
return @[RCTCustomInputControllerKeyboardResigendEvent];
84+
return @[RCTCustomInputControllerKeyboardResigendEventTemp];
8585
}
8686

8787
RCT_EXPORT_MODULE(CustomInputControllerTemp)
@@ -144,7 +144,7 @@ - (BOOL)shouldUseSafeAreaFrom:(NSDictionary *)params {
144144
RCTCustomKeyboardViewControllerTemp* customKeyboardController = [[RCTCustomKeyboardViewControllerTemp alloc] initWithUsingSafeArea:useSafeArea];
145145
customKeyboardController.rootView = rv;
146146

147-
_WXInputHelperView* helperView = [[_WXInputHelperView alloc] initWithFrame:CGRectZero];
147+
_WXInputHelperViewTemp* helperView = [[_WXInputHelperViewTemp alloc] initWithFrame:CGRectZero];
148148
helperView.tag = kHlperViewTag;
149149
helperView.delegate = self;
150150

@@ -210,7 +210,7 @@ - (BOOL)shouldUseSafeAreaFrom:(NSDictionary *)params {
210210
UIView* inputField = [self.bridge.uiManager viewForReactTag:inputFieldTag];
211211
if(inputField != nil)
212212
{
213-
_WXInputHelperView* helperView = [inputField.superview viewWithTag:kHlperViewTag];
213+
_WXInputHelperViewTemp* helperView = [inputField.superview viewWithTag:kHlperViewTag];
214214
if(helperView != nil && [helperView isFirstResponder])
215215
{//restore the first responder only if it was already the first responder to prevent the keyboard from opening again if not necessary
216216
[inputField reactFocus];
@@ -232,7 +232,7 @@ -(void)changeKeyboardHeightForInput:(nonnull NSNumber*)inputFieldTag newHeight:(
232232
UIView* inputField = [self.bridge.uiManager viewForReactTag:inputFieldTag];
233233
if(inputField != nil)
234234
{
235-
_WXInputHelperView* helperView = [inputField.superview viewWithTag:kHlperViewTag];
235+
_WXInputHelperViewTemp* helperView = [inputField.superview viewWithTag:kHlperViewTag];
236236
if(helperView != nil)
237237
{
238238
[((RCTCustomKeyboardViewControllerTemp*)helperView.inputViewController) setAllowsSelfSizing:YES];
@@ -288,7 +288,7 @@ -(UIColor*)reactViewAvgColor:(RCTRootView*)rootView
288288
UIView* inputField = [self.bridge.uiManager viewForReactTag:inputFieldTag];
289289
if(inputField != nil)
290290
{
291-
_WXInputHelperView* helperView = [inputField.superview viewWithTag:kHlperViewTag];
291+
_WXInputHelperViewTemp* helperView = [inputField.superview viewWithTag:kHlperViewTag];
292292
if(helperView != nil)
293293
{
294294
_performingExpandTransition = YES;
@@ -318,7 +318,7 @@ -(UIColor*)reactViewAvgColor:(RCTRootView*)rootView
318318
}];
319319

320320
[[LNAnimatorTemp animatorWithDuration:0.5
321-
animations:@[[LNViewAnimation animationWithView:_fullScreenWindow keyPath:@"frame" toValue:[NSValue valueWithCGRect:[UIScreen mainScreen].bounds]]]
321+
animations:@[[LNViewAnimationTemp animationWithView:_fullScreenWindow keyPath:@"frame" toValue:[NSValue valueWithCGRect:[UIScreen mainScreen].bounds]]]
322322
completionHandler:^(BOOL completed)
323323
{
324324
[UIView performWithoutAnimation:^{
@@ -344,7 +344,7 @@ -(UIColor*)reactViewAvgColor:(RCTRootView*)rootView
344344
UIView* inputField = [self.bridge.uiManager viewForReactTag:inputFieldTag];
345345
if(inputField != nil)
346346
{
347-
_WXInputHelperView* helperView = [inputField.superview viewWithTag:kHlperViewTag];
347+
_WXInputHelperViewTemp* helperView = [inputField.superview viewWithTag:kHlperViewTag];
348348
if(helperView != nil)
349349
{
350350
_performingExpandTransition = YES;
@@ -366,7 +366,7 @@ -(UIColor*)reactViewAvgColor:(RCTRootView*)rootView
366366
[_fullScreenWindow endEditing:YES];
367367

368368
[[LNAnimatorTemp animatorWithDuration:0.5
369-
animations:@[[LNViewAnimation animationWithView:_fullScreenWindow keyPath:@"frame" toValue:[NSValue valueWithCGRect:keyboardTargetFrame]]]
369+
animations:@[[LNViewAnimationTemp animationWithView:_fullScreenWindow keyPath:@"frame" toValue:[NSValue valueWithCGRect:keyboardTargetFrame]]]
370370
completionHandler:^(BOOL completed)
371371
{
372372
RCTCustomKeyboardViewControllerTemp *customKeyboardViewController = (RCTCustomKeyboardViewControllerTemp*)helperView.inputViewController;
@@ -388,13 +388,13 @@ -(UIColor*)reactViewAvgColor:(RCTRootView*)rootView
388388
}
389389
}
390390

391-
#pragma mark - _WXInputHelperViewDelegate methods
391+
#pragma mark - _WXInputHelperViewDelegateTemp methods
392392

393393
-(void)_WXInputHelperViewResignFirstResponder:(UIView*)wxInputHelperView
394394
{
395395
if(self.customInputComponentPresented)
396396
{
397-
[self sendEventWithName:RCTCustomInputControllerKeyboardResigendEvent body:nil];
397+
[self sendEventWithName:RCTCustomInputControllerKeyboardResigendEventTemp body:nil];
398398
}
399399
self.customInputComponentPresented = NO;
400400
}

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uilib-native",
3-
"version": "3.0.1",
3+
"version": "3.0.2",
44
"homepage": "https://github.com/wix/react-native-ui-lib",
55
"description": "uilib native components (separated from js components)",
66
"main": "components/index.js",

0 commit comments

Comments
 (0)