Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.9.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
SBiOSoftWhare committed Mar 21, 2019
2 parents 4b60b84 + d3b6240 commit c18f51c
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 25 deletions.
13 changes: 11 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
Changes in MatrixKit in 0.9.x (2019-03-13)
Changes in MatrixKit in 0.9.8 (2019-03-21)
==========================================

Improvements:
* Upgrade MatrixSDK version ([v0.12.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.12.4)).

Bug fix:
* MXKRoomBubbleTableViewCell: Fix tap on file attachment when using a messageTextView of class `MXKMessageTextView` (PR #532).

Changes in MatrixKit in 0.9.7 (2019-03-13)
==========================================

Bug fix:
* A left room is stuck in my joined room (vector-im/riot-ios/issues/2318)
* A left room is stuck in my joined room (vector-im/riot-ios/issues/2318).

Changes in MatrixKit in 0.9.6 (2019-03-08)
==========================================
Expand Down
4 changes: 2 additions & 2 deletions MatrixKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixKit"
s.version = "0.9.7"
s.version = "0.9.8"
s.summary = "The Matrix reusable UI library for iOS based on MatrixSDK."

s.description = <<-DESC
Expand All @@ -21,7 +21,7 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.dependency 'MatrixSDK', '0.12.3'
s.dependency 'MatrixSDK', '0.12.4'
s.dependency 'HPGrowingTextView', '~> 1.1'
s.dependency 'libPhoneNumber-iOS', '~> 0.9.13'
s.dependency 'DTCoreText', '~> 1.6.21'
Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/Utils/MXKConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#import "MXKConstants.h"

NSString *const MatrixKitVersion = @"0.9.7";
NSString *const MatrixKitVersion = @"0.9.8";

NSString *const kMXKErrorNotification = @"kMXKErrorNotification";

Expand Down
48 changes: 35 additions & 13 deletions MatrixKit/Views/RoomBubbleList/MXKRoomBubbleTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ - (void)render:(MXKCellData *)cellData
NSAttributedString* newText = nil;

// Underline attached file name
if (bubbleData.attachment && (bubbleData.attachment.type == MXKAttachmentTypeFile || bubbleData.attachment.type == MXKAttachmentTypeAudio) && bubbleData.attachment.contentURL && bubbleData.attachment.contentInfo)
if (self.isBubbleDataContainsFileAttachment)
{
NSMutableAttributedString *updatedText = [[NSMutableAttributedString alloc] initWithAttributedString:bubbleData.attributedTextMessage];
[updatedText addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, updatedText.length)];
Expand Down Expand Up @@ -1040,6 +1040,14 @@ - (BOOL)shouldInteractWithURL:(NSURL *)URL urlItemInteractionValue:(NSNumber*)ur
return [delegate cell:self shouldDoAction:kMXKRoomBubbleCellShouldInteractWithURL userInfo:userInfo defaultValue:YES];
}

- (BOOL)isBubbleDataContainsFileAttachment
{
return bubbleData.attachment
&& (bubbleData.attachment.type == MXKAttachmentTypeFile || bubbleData.attachment.type == MXKAttachmentTypeAudio)
&& bubbleData.attachment.contentURL
&& bubbleData.attachment.contentInfo;
}

#pragma mark - Attachment progress handling

- (void)updateProgressUI:(NSDictionary*)statisticsDict
Expand Down Expand Up @@ -1189,7 +1197,8 @@ - (IBAction)onMessageTap:(UITapGestureRecognizer*)sender
if (delegate)
{
// Check whether the current displayed text corresponds to an attached file
if (bubbleData.attachment && (bubbleData.attachment.type == MXKAttachmentTypeFile || bubbleData.attachment.type == MXKAttachmentTypeAudio) && bubbleData.attachment.contentURL && bubbleData.attachment.contentInfo)
// NOTE: This assumes that a cell with attachment has only one `MXKRoomBubbleComponent`
if (self.isBubbleDataContainsFileAttachment)
{
[delegate cell:self didRecognizeAction:kMXKRoomBubbleCellTapOnAttachmentView userInfo:nil];
}
Expand Down Expand Up @@ -1337,23 +1346,36 @@ - (IBAction)onContentViewTap:(UITapGestureRecognizer*)sender
}
else if (self.messageTextView)
{
// Check whether the user tapped in front of a text component.
tapPoint = [sender locationInView:self.messageTextView];
// NOTE: A tap on messageTextView using `MXKMessageTextView` class fallback here if the user does not tap on a link.

if (tapPoint.y > 0 && tapPoint.y < self.messageTextView.frame.size.height)
// Use the same hack as `onMessageTap:`, check whether the current displayed text corresponds to an attached file
// NOTE: This assumes that a cell with attachment has only one `MXKRoomBubbleComponent`
if (self.isBubbleDataContainsFileAttachment)
{
// Consider by default the first component
tappedComponent = [bubbleComponents firstObject];
// This assume that an attachment use one cell in the application using MatrixKit
// This condition is a fix to handle
[delegate cell:self didRecognizeAction:kMXKRoomBubbleCellTapOnAttachmentView userInfo:nil];
}
else
{
// Check whether the user tapped in front of a text component.
tapPoint = [sender locationInView:self.messageTextView];

for (NSInteger index = 1; index < bubbleComponents.count; index++)
if (tapPoint.y > 0 && tapPoint.y < self.messageTextView.frame.size.height)
{
// Here the bubble is composed by multiple text messages
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (tapPoint.y < component.position.y)
// Consider by default the first component
tappedComponent = [bubbleComponents firstObject];

for (NSInteger index = 1; index < bubbleComponents.count; index++)
{
break;
// Here the bubble is composed by multiple text messages
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (tapPoint.y < component.position.y)
{
break;
}
tappedComponent = component;
}
tappedComponent = component;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ target "MatrixKitSample" do

# Different flavours of pods to Matrix SDK
# The tagged version on which this version of MatrixKit has been built
pod 'MatrixSDK', '0.12.3'
pod 'MatrixSDK', '0.12.4'

# The lastest release available on the CocoaPods repository
#pod 'MatrixSDK'
Expand Down
12 changes: 6 additions & 6 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ PODS:
- JSQSystemSoundPlayer (2.0.1)
- libbase58 (0.1.4)
- libPhoneNumber-iOS (0.9.13)
- MatrixSDK (0.12.3):
- MatrixSDK/Core (= 0.12.3)
- MatrixSDK/Core (0.12.3):
- MatrixSDK (0.12.4):
- MatrixSDK/Core (= 0.12.4)
- MatrixSDK/Core (0.12.4):
- AFNetworking (~> 3.2.0)
- GZIP (~> 1.2.2)
- libbase58 (~> 0.1.4)
Expand All @@ -62,7 +62,7 @@ DEPENDENCIES:
- HPGrowingTextView (~> 1.1)
- JSQMessagesViewController (~> 7.2.0)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.12.3)
- MatrixSDK (= 0.12.4)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
Expand Down Expand Up @@ -91,10 +91,10 @@ SPEC CHECKSUMS:
JSQSystemSoundPlayer: c5850e77a4363ffd374cd851154b9af93264ed8d
libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd
libPhoneNumber-iOS: e444379ac18bbfbdefad571da735b2cd7e096caa
MatrixSDK: 36c1a0da01a2745d4ffcca73e080610f05d47009
MatrixSDK: 310efb69f70b4d7772f6f134b06fbb9ec238e6a7
OLMKit: 88eda69110489f817d59bcb4353b7c247570aa4f
Realm: 50071da38fe079e0735e47c9f2eae738c68c5996

PODFILE CHECKSUM: 77b3c1df0318ccafbbe33b3f280cb55ec07c0139
PODFILE CHECKSUM: 2de5c9ad34d958a279230324ed81ae1e18fb36ce

COCOAPODS: 1.6.1

0 comments on commit c18f51c

Please sign in to comment.