Moving SKHighlightOverlay
Summary: Moving FlipperKitLayoutPlugin/FlipperKitPluginUtils/SKHighlightOverlay to shared folder, so Layout and WorkingRange plugins can depend on it Reviewed By: kevin0571 Differential Revision: D17156396 fbshipit-source-id: 3f17371f2ab4818924d61e6cfb243f60ad1f2892
This commit is contained in:
committed by
Facebook Github Bot
parent
26c9bf3853
commit
eff95991c6
@@ -20,7 +20,7 @@
|
||||
#import <ComponentKit/CKInsetComponent.h>
|
||||
#import <ComponentKit/CKFlexboxComponent.h>
|
||||
|
||||
#import <FlipperKitLayoutPlugin/SKHighlightOverlay.h>
|
||||
#import <FlipperKitHighlightOverlay/SKHighlightOverlay.h>
|
||||
#import <FlipperKitLayoutPlugin/SKObject.h>
|
||||
#import <FlipperKitLayoutTextSearchable/FKTextSearchable.h>
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*/
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface SKHighlightOverlay : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
+ (UIColor*)overlayColor;
|
||||
|
||||
- (void)mountInView:(UIView *)view withFrame:(CGRect)frame;
|
||||
- (void)unmount;
|
||||
|
||||
@end
|
||||
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the LICENSE
|
||||
* file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
#if FB_SONARKIT_ENABLED
|
||||
|
||||
#import "SKHighlightOverlay.h"
|
||||
|
||||
@implementation SKHighlightOverlay
|
||||
{
|
||||
CALayer *_overlayLayer;
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static SKHighlightOverlay *sharedInstance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
sharedInstance = [self new];
|
||||
});
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
_overlayLayer = [CALayer layer];
|
||||
_overlayLayer.backgroundColor = [SKHighlightOverlay overlayColor].CGColor;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)mountInView:(UIView *)view withFrame:(CGRect)frame {
|
||||
[CATransaction begin];
|
||||
[CATransaction setValue:(id)kCFBooleanTrue
|
||||
forKey:kCATransactionDisableActions];
|
||||
_overlayLayer.frame = frame;
|
||||
[view.layer addSublayer: _overlayLayer];
|
||||
[CATransaction commit];
|
||||
}
|
||||
|
||||
- (void)unmount {
|
||||
[_overlayLayer removeFromSuperlayer];
|
||||
}
|
||||
|
||||
+ (UIColor*)overlayColor {
|
||||
return [UIColor colorWithRed:136.0 / 255.0 green:117.0 / 255.0 blue:197.0 / 255.0 alpha:0.6];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -9,9 +9,10 @@
|
||||
|
||||
#import "SKTapListenerImpl.h"
|
||||
|
||||
#import "SKHighlightOverlay.h"
|
||||
#import "SKHiddenWindow.h"
|
||||
|
||||
#import <FlipperKitHighlightOverlay/SKHighlightOverlay.h>
|
||||
|
||||
@implementation SKTapListenerImpl
|
||||
{
|
||||
NSMutableArray<SKTapReceiver> *_receiversWaitingForInput;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
#import "SKViewDescriptor.h"
|
||||
|
||||
#import "SKDescriptorMapper.h"
|
||||
#import "SKHighlightOverlay.h"
|
||||
#import "SKNamed.h"
|
||||
#import "SKObject.h"
|
||||
#import "SKYogaKitHelper.h"
|
||||
#import "UIColor+SKSonarValueCoder.h"
|
||||
#import <YogaKit/UIView+Yoga.h>
|
||||
#import <FlipperKitHighlightOverlay/SKHighlightOverlay.h>
|
||||
|
||||
@implementation SKViewDescriptor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user