Skip to content

Commit f213eb8

Browse files
authored
Merge pull request #115 from QuickBlox/revert-113-feature/linkPreview_tabbar
Revert "media attachments"
2 parents b84216d + a1ba00e commit f213eb8

122 files changed

Lines changed: 1388 additions & 6234 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

PublicCocoaPods/.swift-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

PublicCocoaPods/QMChatViewController.podspec

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ Pod::Spec.new do |s|
3636
ss.source_files = 'QMChatViewController/QMChatLocationSnapshotter/*.{h,m}'
3737
end
3838

39-
s.subspec 'QMMediaPresenter' do |ss|
40-
ss.source_files = 'QMChatViewController/QMMediaPresenter/**/*.{h,m}'
41-
end
42-
4339
s.subspec 'Categories' do |ss|
4440
ss.dependency 'QMChatViewController/QMChatLocationSnapshotter'
4541
ss.source_files = 'QMChatViewController/Categories/*.{h,m}'
@@ -76,7 +72,6 @@ Pod::Spec.new do |s|
7672
s.prefix_header_contents = '#import <Quickblox/Quickblox.h>'
7773
s.dependency "QuickBlox", ">= 2.0"
7874
s.dependency "TTTAttributedLabel", "> 1.13"
79-
s.dependency "SDWebImage", "~> 3.8.2"
80-
s.dependency "SexyTooltip"
75+
s.dependency "SDWebImage", "~> 3.6"
8176

8277
end

QMCVDevelopment.podspec

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ Pod::Spec.new do |s|
3434
ss.source_files = 'QMChatViewController/QMChatLocationSnapshotter/*.{h,m}'
3535
end
3636

37-
s.subspec 'QMMediaPresenter' do |ss|
38-
ss.source_files = 'QMChatViewController/QMMediaPresenter/**/*.{h,m}'
39-
end
40-
4137
s.subspec 'Categories' do |ss|
4238
ss.dependency 'QMCVDevelopment/QMChatLocationSnapshotter'
4339
ss.source_files = 'QMChatViewController/Categories/*.{h,m}'
@@ -48,12 +44,6 @@ Pod::Spec.new do |s|
4844
ss.source_files = 'QMChatViewController/Utils/**/*.{h,m}'
4945
end
5046

51-
s.subspec 'ViewModels' do |ss|
52-
53-
ss.dependency 'QMCVDevelopment/Categories'
54-
ss.source_files = 'QMChatViewController/ViewModels/**/*.{h,m}'
55-
end
56-
5747
s.subspec 'Sections' do |ss|
5848
ss.dependency 'QMCVDevelopment/QMChatDataSource'
5949
ss.source_files = 'QMChatViewController/QMChatSection/*.{h,m}'
@@ -78,9 +68,7 @@ Pod::Spec.new do |s|
7868
s.requires_arc = true
7969
s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/../../Framework $(PODS_ROOT)/../External" }
8070
s.dependency "TTTAttributedLabel", "> 1.13"
81-
s.dependency "SDWebImage", "~> 3.8.2"
82-
s.dependency "FFCircularProgressView"
83-
s.dependency "SexyTooltip"
71+
s.dependency "SDWebImage", "~> 3.6"
8472

8573

8674
end

QMChatViewController/Categories/UIColor+QM.h

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

1111
@interface UIColor (QM)
1212

13-
//MARK: - Message bubble colors
13+
#pragma mark - Message bubble colors
1414

1515
/**
1616
* @return A color object containing HSB values similar to the iOS 7 messages app green bubble color.

QMChatViewController/Categories/UIImage+Cropper.m

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -68,69 +68,29 @@ - (UIImage *)imageByScaleAndCrop:(CGSize)targetSize {
6868
}
6969

7070
- (UIImage *)imageByCircularScaleAndCrop:(CGSize)targetSize {
71-
//bitmap context properties
72-
float scaleFactor = [[UIScreen mainScreen] scale];
7371

74-
CGColorSpaceRef colorSpace =
75-
CGColorSpaceCreateDeviceRGB();
76-
CGContextRef context =
77-
CGBitmapContextCreate(NULL,
78-
targetSize.width * scaleFactor,
79-
targetSize.height * scaleFactor,
80-
8,
81-
targetSize.width * scaleFactor * 4,
82-
colorSpace,
83-
kCGImageAlphaPremultipliedFirst);
84-
85-
CGContextScaleCTM(context,
86-
scaleFactor,
87-
scaleFactor);
88-
89-
CGContextBeginPath(context);
90-
91-
CGContextAddArc(context,
92-
targetSize.width / 2,
93-
targetSize.height / 2,
94-
targetSize.width / 2,
95-
0,
96-
2 * M_PI,
97-
0);
98-
99-
CGContextClosePath(context);
100-
101-
CGFloat widthFactor = targetSize.width / self.size.width;
102-
CGFloat heightFactor = targetSize.height / self.size.height;
103-
104-
if (widthFactor > heightFactor) {
105-
scaleFactor = widthFactor;
106-
}
107-
else {
108-
109-
scaleFactor = heightFactor;
110-
}
111-
112-
float w = self.size.width * scaleFactor;
113-
float h = self.size.height * scaleFactor;
72+
//Create the bitmap graphics context
73+
UIGraphicsBeginImageContextWithOptions(targetSize, NO, 0.0);
11474

75+
CGContextRef context = UIGraphicsGetCurrentContext();
76+
// Create and CLIP to a CIRCULAR Path
77+
// (This could be replaced with any closed path if you want a different shaped clip)
78+
CGContextBeginPath (context);
79+
CGContextAddArc(context, targetSize.width / 2, targetSize.height / 2, targetSize.width / 2, 0, 2 * M_PI, 0);
80+
CGContextClosePath (context);
11581
CGContextClip(context);
116-
//draw image into bitmap context
117-
CGContextDrawImage(context,
118-
CGRectMake(0,0, w, h),
119-
self.CGImage);
120-
121-
CGImageRef renderedImage =
122-
CGBitmapContextCreateImage(context);
82+
//Set the SCALE factor for the graphics context
83+
//All future draw calls will be scaled by this factor
84+
CGContextScaleCTM (context, targetSize.width / self.size.width, targetSize.height / self.size.height);
85+
// Draw the IMAGE
86+
CGRect myRect = CGRectMake(0, 0, self.size.width, self.size.height);
87+
[self drawInRect:myRect];
12388

124-
//tidy up
125-
CGColorSpaceRelease(colorSpace);
126-
CGContextRelease(context);
89+
UIImage *circularImage = UIGraphicsGetImageFromCurrentImageContext();
12790

128-
UIImage *image =
129-
[UIImage imageWithCGImage:renderedImage
130-
scale:0
131-
orientation:self.imageOrientation];
91+
UIGraphicsEndImageContext();
13292

133-
return image;
93+
return circularImage;
13494
}
13595

13696
@end

QMChatViewController/Categories/UIImageView+QMLocationSnapshot.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ - (void)setSnapshotWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordi
3838
self.image = nil;
3939
[self qm_cancelPreviousSnapshotCreation];
4040

41-
NSString *key = [NSString stringWithFormat:@"%lf/%lf", locationCoordinate.latitude, locationCoordinate.longitude];
41+
NSString *key = [NSString stringWithFormat:@"%lf/%lf",locationCoordinate.latitude, locationCoordinate.longitude];
4242

4343
self.qm_snapshotKey = key;
4444

@@ -48,8 +48,10 @@ - (void)setSnapshotWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordi
4848
key:key
4949
completion:^(UIImage *snapshot) {
5050

51-
if ([weakSelf.qm_snapshotKey isEqualToString:key]) {
52-
weakSelf.image = snapshot;
51+
__typeof(weakSelf)strongSelf = weakSelf;
52+
if ([strongSelf.qm_snapshotKey isEqualToString:key]) {
53+
54+
strongSelf.image = snapshot;
5355
}
5456
}];
5557
}

QMChatViewController/Icons/Media.xcassets/Contents.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

QMChatViewController/Icons/Media.xcassets/Image.imageset/Contents.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

QMChatViewController/Icons/Media.xcassets/ic_audio.imageset/Contents.json

Lines changed: 0 additions & 15 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)