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

Commit

Permalink
Merge remote-tracking branch 'origin/release-v0.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
giomfo committed Mar 17, 2016
2 parents f3eae71 + 0b59e9a commit 62eaf06
Show file tree
Hide file tree
Showing 27 changed files with 398 additions and 121 deletions.
13 changes: 13 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Changes in MatrixKit in 0.3.4 (2016-03-17)
===============================================

Improvements:
* MXKWebViewViewController: add view controller for webview display.

Bug fixes:
* Chat Screen: scrolling to bottom when opening new rooms seems unreliable.
* Chat Screen: Wrong displayName and wrong avatar are displayed on invitation.
* Chat Screen: Some messages are displayed twice.
* Chat Screen: Some unsent messages are persistent.
* Fix missing loading wheel when app is resumed.

Changes in MatrixKit in 0.3.3 (2016-03-07)
===============================================

Expand Down
6 changes: 3 additions & 3 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.3.3"
s.version = "0.3.4"
s.summary = "The Matrix reusable UI library for iOS based on MatrixSDK."

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

s.platform = :ios, "7.0"

s.source = { :git => "https://github.com/matrix-org/matrix-ios-kit.git", :tag => "v0.3.3" }
s.source = { :git => "https://github.com/matrix-org/matrix-ios-kit.git", :tag => "v0.3.4" }
s.source_files = "MatrixKit", "MatrixKit/**/*.{h,m}"
s.resources = "MatrixKit/**/*.{xib}", "MatrixKit/Assets/MatrixKitAssets.bundle"

s.requires_arc = true

s.dependency 'MatrixSDK', '~> 0.6.3'
s.dependency 'MatrixSDK', '~> 0.6.4'
s.dependency 'HPGrowingTextView', '~> 1.1'
s.dependency 'libPhoneNumber-iOS', '~> 0.8.7'

Expand Down
6 changes: 6 additions & 0 deletions MatrixKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
71DE22E71BCE3FF200284153 /* MXKRoomBubbleCellDataWithIncomingAppendingMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 71DE22E51BCE3FF200284153 /* MXKRoomBubbleCellDataWithIncomingAppendingMode.m */; };
71EBE6631C04608100E7D953 /* MXKRoomActivitiesView.m in Sources */ = {isa = PBXBuildFile; fileRef = 71EBE6621C04608100E7D953 /* MXKRoomActivitiesView.m */; };
8B9E9737BF25A512725372BE /* libPods-MatrixKitSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C994EE81FBAC79EE746DF4E5 /* libPods-MatrixKitSample.a */; };
F0026B661C91EED1001D2C04 /* MXKWebViewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F0026B651C91EED1001D2C04 /* MXKWebViewViewController.m */; };
F0036EEF1AB98DC40008E432 /* MXKRoomInputToolbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = F0036EED1AB98DC40008E432 /* MXKRoomInputToolbarView.m */; };
F0036EF01AB98DC40008E432 /* MXKRoomInputToolbarView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F0036EEE1AB98DC40008E432 /* MXKRoomInputToolbarView.xib */; };
F003FD4F1B4E64B4000FC7A5 /* NSData+MatrixKit.m in Sources */ = {isa = PBXBuildFile; fileRef = F003FD4E1B4E64B4000FC7A5 /* NSData+MatrixKit.m */; };
Expand Down Expand Up @@ -263,6 +264,8 @@
71EBE6621C04608100E7D953 /* MXKRoomActivitiesView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXKRoomActivitiesView.m; sourceTree = "<group>"; };
C994EE81FBAC79EE746DF4E5 /* libPods-MatrixKitSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MatrixKitSample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D473CAF02D2D0996B98A23E8 /* Pods-MatrixKitSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrixKitSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MatrixKitSample/Pods-MatrixKitSample.debug.xcconfig"; sourceTree = "<group>"; };
F0026B641C91EED1001D2C04 /* MXKWebViewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXKWebViewViewController.h; sourceTree = "<group>"; };
F0026B651C91EED1001D2C04 /* MXKWebViewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXKWebViewViewController.m; sourceTree = "<group>"; };
F0036EEC1AB98DC40008E432 /* MXKRoomInputToolbarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXKRoomInputToolbarView.h; sourceTree = "<group>"; };
F0036EED1AB98DC40008E432 /* MXKRoomInputToolbarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXKRoomInputToolbarView.m; sourceTree = "<group>"; };
F0036EEE1AB98DC40008E432 /* MXKRoomInputToolbarView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MXKRoomInputToolbarView.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -642,6 +645,8 @@
F094EC651ABAC380006B8CE3 /* MXKViewController.h */,
F094EC661ABAC380006B8CE3 /* MXKViewController.m */,
F00C25281ADBC3C100065077 /* MXKViewControllerHandling.h */,
F0026B641C91EED1001D2C04 /* MXKWebViewViewController.h */,
F0026B651C91EED1001D2C04 /* MXKWebViewViewController.m */,
);
path = Controllers;
sourceTree = "<group>";
Expand Down Expand Up @@ -1392,6 +1397,7 @@
F06E76991AF0FED000980E5A /* MXKAuthInputsView.m in Sources */,
F094EC671ABAC380006B8CE3 /* MXKViewController.m in Sources */,
F0CF98E31B0B7FDC00EAE373 /* MXKTableViewCellWithTextView.m in Sources */,
F0026B661C91EED1001D2C04 /* MXKWebViewViewController.m in Sources */,
F0B0ECC41B14B16C005EB20D /* MXKRoomTitleView.m in Sources */,
F095E50F1B25899F009606CE /* MXKContactManager.m in Sources */,
F0CE56EB1AA8BB5E003BE77A /* MXKSampleMainTableViewController.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/Controllers/MXKRoomMemberDetailsViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ typedef enum : NSUInteger
@param value the value to set.
*/
- (void)setPowerLevel:(NSUInteger)value;
- (void)setPowerLevel:(NSInteger)value;

@end

10 changes: 5 additions & 5 deletions MatrixKit/Controllers/MXKRoomMemberDetailsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
{
// Check user's power level before allowing an action (kick, ban, ...)
MXRoomPowerLevels *powerLevels = [mxRoom.state powerLevels];
NSUInteger memberPowerLevel = [powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];
NSUInteger oneSelfPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
NSInteger memberPowerLevel = [powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];
NSInteger oneSelfPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];

[actionsArray removeAllObjects];

Expand Down Expand Up @@ -694,9 +694,9 @@ - (void)removePendingActionMask
}
}

- (void)setPowerLevel:(NSUInteger)value
- (void)setPowerLevel:(NSInteger)value
{
NSUInteger currentPowerLevel = [self.mxRoom.state.powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];
NSInteger currentPowerLevel = [self.mxRoom.state.powerLevels powerLevelOfUserWithUserID:_mxRoomMember.userId];

// check if the power level has not yet been set to 0
if (value != currentPowerLevel)
Expand Down Expand Up @@ -740,7 +740,7 @@ - (void)updateUserPowerLevel
[self.actionMenu addTextFieldWithConfigurationHandler:^(UITextField *textField)
{
textField.secureTextEntry = NO;
textField.text = [NSString stringWithFormat:@"%tu", [weakSelf.mxRoom.state.powerLevels powerLevelOfUserWithUserID:weakSelf.mxRoomMember.userId]];
textField.text = [NSString stringWithFormat:@"%zd", [weakSelf.mxRoom.state.powerLevels powerLevelOfUserWithUserID:weakSelf.mxRoomMember.userId]];
textField.placeholder = nil;
textField.keyboardType = UIKeyboardTypeDecimalPad;
}];
Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/Controllers/MXKRoomMemberListViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ - (void)refreshUIBarButtons
{
// Check conditions to be able to invite someone
MXRoom *mxRoom = [self.mainSession roomWithRoomId:dataSource.roomId];
NSUInteger oneSelfPowerLevel = [mxRoom.state.powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
NSInteger oneSelfPowerLevel = [mxRoom.state.powerLevels powerLevelOfUserWithUserID:self.mainSession.myUser.userId];
if (oneSelfPowerLevel < [mxRoom.state.powerLevels invite])
{
showInvitationOption = NO;
Expand Down
2 changes: 1 addition & 1 deletion MatrixKit/Controllers/MXKRoomSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ - (void)checkIfSuperUser
{
// Check whether the user has enough power to rename the room
MXRoomPowerLevels *powerLevels = [mxRoomState powerLevels];
NSUInteger userPowerLevel = [powerLevels powerLevelOfUserWithUserID:_session.myUser.userId];
NSInteger userPowerLevel = [powerLevels powerLevelOfUserWithUserID:_session.myUser.userId];

isSuperUser = (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName]);
}
Expand Down
6 changes: 4 additions & 2 deletions MatrixKit/Controllers/MXKRoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,10 @@ - (void)triggerPagination:(NSUInteger)limit direction:(MXTimelineDirection)direc
[self.bubblesTableView setContentOffset:contentOffset animated:NO];
}
}

[self.bubblesTableView setContentOffset:contentOffset animated:NO];
else
{
[self.bubblesTableView setContentOffset:contentOffset animated:NO];
}

// Restore scrolling and the scroll indicator
[self.bubblesTableView setShowsVerticalScrollIndicator:YES];
Expand Down
31 changes: 17 additions & 14 deletions MatrixKit/Controllers/MXKTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,12 @@ - (void)onMatrixSessionChange
}
}

if (mxSessionArray.count && enableBarTintColorStatusChange)
if (mxSessionArray.count)
{
// The navigation bar tintColor depends on matrix homeserver reachability status
// Check each session state
UIColor *barTintColor = defaultBarTintColor;
BOOL allHomeserverNotReachable = YES;
BOOL isActivityInProgress = NO;

// Check each session state
for (NSUInteger index = 0; index < mxSessionArray.count;)
{
MXSession *mxSession = mxSessionArray[index];
Expand Down Expand Up @@ -360,20 +358,25 @@ - (void)onMatrixSessionChange
}
}

if (allHomeserverNotReachable)
// Check whether the navigation bar color depends on homeserver reachability.
if (enableBarTintColorStatusChange)
{
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
if (mainNavigationController)
// The navigation bar tintColor reflects the matrix homeserver reachability status.
if (allHomeserverNotReachable)
{
mainNavigationController.navigationBar.barTintColor = [UIColor redColor];
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
if (mainNavigationController)
{
mainNavigationController.navigationBar.barTintColor = [UIColor redColor];
}
}
}
else
{
self.navigationController.navigationBar.barTintColor = barTintColor;
if (mainNavigationController)
else
{
mainNavigationController.navigationBar.barTintColor = barTintColor;
self.navigationController.navigationBar.barTintColor = barTintColor;
if (mainNavigationController)
{
mainNavigationController.navigationBar.barTintColor = barTintColor;
}
}
}

Expand Down
31 changes: 17 additions & 14 deletions MatrixKit/Controllers/MXKViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,12 @@ - (void)onMatrixSessionChange
}
}

if (mxSessionArray.count && enableBarTintColorStatusChange)
if (mxSessionArray.count)
{
// The navigation bar tintColor depends on matrix homeserver reachability status
// Check each session state.
UIColor *barTintColor = defaultBarTintColor;
BOOL allHomeserverNotReachable = YES;
BOOL isActivityInProgress = NO;

// Check each session state
for (NSUInteger index = 0; index < mxSessionArray.count;)
{
MXSession *mxSession = mxSessionArray[index];
Expand Down Expand Up @@ -377,20 +375,25 @@ - (void)onMatrixSessionChange
}
}

if (allHomeserverNotReachable)
// Check whether the navigation bar color depends on homeserver reachability.
if (enableBarTintColorStatusChange)
{
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
if (mainNavigationController)
// The navigation bar tintColor reflects the matrix homeserver reachability status.
if (allHomeserverNotReachable)
{
mainNavigationController.navigationBar.barTintColor = [UIColor redColor];
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
if (mainNavigationController)
{
mainNavigationController.navigationBar.barTintColor = [UIColor redColor];
}
}
}
else
{
self.navigationController.navigationBar.barTintColor = barTintColor;
if (mainNavigationController)
else
{
mainNavigationController.navigationBar.barTintColor = barTintColor;
self.navigationController.navigationBar.barTintColor = barTintColor;
if (mainNavigationController)
{
mainNavigationController.navigationBar.barTintColor = barTintColor;
}
}
}

Expand Down
44 changes: 44 additions & 0 deletions MatrixKit/Controllers/MXKWebViewViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

#import "MXKViewController.h"

/**
'MXKWebViewViewController' instance is used to display a webview.
*/
@interface MXKWebViewViewController : MXKViewController
{
@protected

/**
The content of this screen is fully displayed by this webview
*/
UIWebView *webView;
}

/**
Init 'MXKWebViewViewController' instance with a web content url.
@param URL the url to open
*/
- (id)initWithURL:(NSString*)URL;

/**
Define the web content url to open
*/
@property (nonatomic) NSString *URL;

@end
Loading

0 comments on commit 62eaf06

Please sign in to comment.