-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
LiuLinhong
committed
May 17, 2018
1 parent
1bdc054
commit 0c38c55
Showing
58 changed files
with
2,281 additions
and
4,392 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...ngcallkit/RongCallKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>IDEDidComputeMac32BitWarning</key> | ||
<true/> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
ios-rongcallkit/RongCallKit/Category/UICollectionView+BackgroundView.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// UICollectionView+BackgroundView.h | ||
// RongCallKit | ||
// | ||
// Created by LiuLinhong on 2018/03/30. | ||
// Copyright © 2018年 Rong Cloud. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "RCCallVideoMultiCallViewController.h" | ||
|
||
@interface UICollectionView (BackgroundView) | ||
|
||
@property (nonatomic, strong) RCCallVideoMultiCallViewController *callVideoMultiCallViewController; | ||
|
||
@end |
116 changes: 116 additions & 0 deletions
116
ios-rongcallkit/RongCallKit/Category/UICollectionView+BackgroundView.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
// | ||
// UICollectionView+BackgroundView.m | ||
// RongCallKit | ||
// | ||
// Created by LiuLinhong on 2018/03/30. | ||
// Copyright © 2018年 Rong Cloud. All rights reserved. | ||
// | ||
|
||
#import "UICollectionView+BackgroundView.h" | ||
#import <objc/runtime.h> | ||
|
||
static NSString *key = @"UICollectionView_BackgroundView"; | ||
|
||
@implementation UICollectionView (BackgroundView) | ||
|
||
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event | ||
{ | ||
NSInteger userCellCount = [self.callVideoMultiCallViewController.subUserModelList count]; | ||
UIView *touchView = self; | ||
if ([self pointInside:point withEvent:event] && self.alpha >= 0.01 && !self.hidden && self.isUserInteractionEnabled) | ||
{ | ||
if ([self isTouchEnable:userCellCount withPoint:point]) | ||
{ | ||
return nil; | ||
} | ||
|
||
if ([self.subviews count] > 0) | ||
{ | ||
for (NSInteger i = ([self.subviews count] - 1); i >= 0; --i) | ||
{ | ||
UIView *subView = self.subviews[i]; | ||
CGPoint subPoint = CGPointMake(point.x - subView.frame.origin.x, | ||
point.y - subView.frame.origin.y); | ||
UIView *subTouchView = [subView hitTest:subPoint withEvent:event]; | ||
if (subTouchView) | ||
{ | ||
touchView = subTouchView; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
touchView = nil; | ||
} | ||
|
||
return touchView; | ||
} | ||
|
||
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event | ||
{ | ||
return CGRectContainsPoint(self.bounds, point); | ||
} | ||
|
||
- (void)setCallVideoMultiCallViewController:(RCCallVideoMultiCallViewController *)vc | ||
{ | ||
objc_setAssociatedObject(self, (__bridge const void *)(key), vc, OBJC_ASSOCIATION_ASSIGN); | ||
} | ||
|
||
- (RCCallVideoMultiCallViewController *)callVideoMultiCallViewController | ||
{ | ||
return objc_getAssociatedObject(self, (__bridge const void *)(key)); | ||
} | ||
|
||
- (BOOL)isTouchEnable:(NSInteger)count withPoint:(CGPoint)point | ||
{ | ||
if (self.tag != 202) | ||
return NO; | ||
|
||
switch (count) | ||
{ | ||
case 1: | ||
if (point.x > 270 && point.y > 85) | ||
return NO; | ||
else | ||
return YES; | ||
case 2: | ||
if (point.x > 190 && point.y > 85) | ||
return NO; | ||
else | ||
return YES; | ||
case 3: | ||
if (point.x > 110 && point.y > 85) | ||
return NO; | ||
else | ||
return YES; | ||
case 4: | ||
if (point.y > 85) | ||
return NO; | ||
else | ||
return YES; | ||
case 5: | ||
if (point.x < 270 && point.y < 85) | ||
return YES; | ||
else | ||
return NO; | ||
case 6: | ||
if (point.x < 190 && point.y < 85) | ||
return YES; | ||
else | ||
return NO; | ||
case 7: | ||
if (point.x < 110 && point.y < 85) | ||
return YES; | ||
else | ||
return NO; | ||
case 8: | ||
return NO; | ||
default: | ||
return NO; | ||
} | ||
return NO; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.