handle negative numbers and rename to imageStrokeColorWidth

This commit is contained in:
Ran Greenberg 2017-12-31 10:14:19 +02:00
parent 92b7d38767
commit 9da6665e59
4 changed files with 14 additions and 12 deletions

View File

@ -166,7 +166,7 @@ Attribute | Values | Description
`minimumInteritemSpacing` | Float | Minimum inner Item spacing
`minimumLineSpacing` | Float | Minimum line spacing
`imageStrokeColor` | Color | Image stroke color
`imageStrokeWidth` | Number | Image stroke width
`imageStrokeColorWidth` | Number > 0 | Image stroke color width
`albumName` | String | Album name to show
`columnCount` | Integer | How many clumns in one row
`onTapImage` | Function | Callback when image tapped

View File

@ -25,7 +25,7 @@
+(void)setUnSlectedImageIcon:(UIImage*)image;
+(void)setSupported:(NSDictionary*)newSupported;
+(void)setImageStrokeColor:(UIColor*)strokeColor;
+(void)setImageStrokeWidth:(NSNumber*)width;
+(void)setImageStrokeColorWidth:(NSNumber*)width;
+(void)setSelection:(NSDictionary*)selectionDict;
+(void)setRemoteDownloadIndicatorColor:(UIColor*)color;
+(void)setRemoteDownloadIndicatorType:(NSString*)type;

View File

@ -42,7 +42,7 @@ static UIImage *selectedImageIcon = nil;
static UIImage *unSelectedImageIcon = nil;
static NSDictionary *supported = nil;
static UIColor *imageStrokeColor = nil;
static NSNumber *imageStrokeWidth = nil;
static NSNumber *imageStrokeColorWidth = nil;
static NSDictionary *selection = nil;
static NSString *imagePosition = nil;
static UIColor *selectionOverlayColor = nil;
@ -85,8 +85,8 @@ static NSString *remoteDownloadIndicatorType = REMOTE_DOWNLOAD_INDICATOR_TYPE_SP
if (strokeColor) imageStrokeColor = strokeColor;
}
+(void)setImageStrokeWidth:(NSNumber*)width {
if (width) imageStrokeWidth = width;
+(void)setImageStrokeColorWidth:(NSNumber*)width {
if (width) imageStrokeColorWidth = width;
}
@ -100,7 +100,7 @@ static NSString *remoteDownloadIndicatorType = REMOTE_DOWNLOAD_INDICATOR_TYPE_SP
unSelectedImageIcon = nil;
supported = nil;
imageStrokeColor = nil;
imageStrokeWidth = nil;
imageStrokeColorWidth = nil;
selection = nil;
imagePosition = nil;
selectionOverlayColor = nil;
@ -170,8 +170,10 @@ static NSString *remoteDownloadIndicatorType = REMOTE_DOWNLOAD_INDICATOR_TYPE_SP
CGRect imageViewFrame = self.bounds;
if(imageStrokeColor) {
imageViewFrame.size.height -= imageStrokeWidth.floatValue;
imageViewFrame.size.width -= imageStrokeWidth.floatValue;
if (imageStrokeColorWidth && imageStrokeColorWidth.floatValue > 0) {
imageViewFrame.size.height -= imageStrokeColorWidth.floatValue;
imageViewFrame.size.width -= imageStrokeColorWidth.floatValue;
}
self.backgroundColor = imageStrokeColor;
}

View File

@ -56,7 +56,7 @@ typedef void (^CompletionBlock)(BOOL success);
@property (nonatomic, strong) UIImage *selectedImageIcon;
@property (nonatomic, strong) UIImage *unSelectedImageIcon;
@property (nonatomic, strong) UIColor *imageStrokeColor;
@property (nonatomic, strong) NSNumber *imageStrokeWidth;
@property (nonatomic, strong) NSNumber *imageStrokeColorWidth;
@property (nonatomic, strong) NSNumber *disableSelectionIcons;
@property (nonatomic, strong) NSDictionary *selection;
@property (nonatomic) UIEdgeInsets contentInset;
@ -221,8 +221,8 @@ static NSString * const CustomCellReuseIdentifier = @"CustomCell";
[CKGalleryCollectionViewCell setImageStrokeColor:imageStrokeColor];
}
-(void)setImageStrokeWidth:(NSNumber *)imageStrokeWidth {
[CKGalleryCollectionViewCell setImageStrokeWidth:imageStrokeWidth];
-(void)setImageStrokeColorWidth:(NSNumber *)imageStrokeColorWidth {
[CKGalleryCollectionViewCell setImageStrokeColorWidth:imageStrokeColorWidth];
}
-(void)setSelection:(NSDictionary *)selection {
@ -711,7 +711,7 @@ RCT_EXPORT_VIEW_PROPERTY(unSelectedImageIcon, UIImage);
RCT_EXPORT_VIEW_PROPERTY(selectedImages, NSArray);
RCT_EXPORT_VIEW_PROPERTY(fileTypeSupport, NSDictionary);
RCT_EXPORT_VIEW_PROPERTY(imageStrokeColor, UIColor);
RCT_EXPORT_VIEW_PROPERTY(imageStrokeWidth, NSNumber);
RCT_EXPORT_VIEW_PROPERTY(imageStrokeColorWidth, NSNumber);
RCT_EXPORT_VIEW_PROPERTY(disableSelectionIcons, NSNumber);
RCT_EXPORT_VIEW_PROPERTY(customButtonStyle, NSDictionary);
RCT_EXPORT_VIEW_PROPERTY(onCustomButtonPress, RCTDirectEventBlock);