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.12.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Jun 30, 2020
2 parents a5ddc3d + c92b9aa commit a8f3e80
Show file tree
Hide file tree
Showing 17 changed files with 314 additions and 105 deletions.
19 changes: 18 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
Changes in MatrixKit in 0.12.7 (2020-05-xx)
=========================================

Improvements:
* Upgrade MatrixSDK version ([v0.16.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.16.6)).
* DTCoreText: Update DTCoreText dependency to 1.6.23 minimum to be sure to not reference UIWebView.
* MXKCountryPickerViewController: Replace deprecated UISearchDisplayController by UISearchViewController.
* MXKLanguagePickerViewController: Replace deprecated UISearchDisplayController by UISearchViewController.
* MXKAppSettings: Add an option to hide un-decryptable events before joining the room.
* MXKRoomDataSource: Hide un-decryptable messages that were sent while the user was not in the room if needed.

Bug fix:
* MXKRoomDataSource: Wait for store data ready when finalizing initialization on data source (vector-im/riot-ios/issues/3159).
* MXKLanguagePickerViewController: Fix selected cell reuse issue.
* MXKRoomDataSource: Wait for initial event existence if provided (vector-im/riot-ios/issues/3290).
* MXKRoomDataSource: Convert one-time observers to block variables to avoid releasing (vector-im/riot-ios/issues/3337).

Changes in MatrixKit in 0.12.6 (2020-05-18)
=========================================

Expand All @@ -18,6 +35,7 @@ Improvements:

Bug fix:
* Replace UIWebView with WKWebView (PR #663).
* Fix range of allowed surrogate emoji characters to 0x1d000-0x1f9ff.

Changes in MatrixKit in 0.12.3 (2020-05-07)
=========================================
Expand Down Expand Up @@ -1402,4 +1420,3 @@ MatrixKit contains the following reusable UI components:
* MXKRecentListViewController
* MXKRoomMemberListViewController


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.12.6"
s.version = "0.12.7"
s.summary = "The Matrix reusable UI library for iOS based on MatrixSDK."

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

s.swift_version = '5.0'

s.dependency 'MatrixSDK', '0.16.5'
s.dependency 'MatrixSDK', '0.16.6'
s.dependency 'HPGrowingTextView', '~> 1.1'
s.dependency 'libPhoneNumber-iOS', '~> 0.9.13'
s.dependency 'DTCoreText', '~> 1.6.21'
s.dependency 'DTCoreText', '~> 1.6.23'
s.dependency 'cmark', '~> 0.24.1'

s.default_subspec = 'Core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,14 @@
"room_member_power_level_prompt" = "Du kannst diese Änderung nicht rückgangig machen, weil du dem Benutzer die gleiche Berechtigungsstufe gibst, die du selbst hast.\nBist du sicher?";
// Attachment
"attachment_size_prompt" = "Möchtest du senden als:";
"attachment_original" = "Aktuelle Größe: %@";
"attachment_original" = "Originalgröße: %@";
"attachment_small" = "Klein: %@";
"attachment_medium" = "Mittel: %@";
"attachment_large" = "Groß: %@";
"attachment_cancel_download" = "Herunterladen abbrechen?";
"attachment_cancel_upload" = "Hochladen abbrechen?";
"attachment_multiselection_size_prompt" = "Bilder senden als:";
"attachment_multiselection_original" = "Aktuelle Größe";
"attachment_multiselection_original" = "Originalgröße";
"attachment_e2e_keys_file_prompt" = "Diese Datei enthält von einem Matrix Client exportierte Schlüssel.\nMöchtest du den Dateiinhalt sehen oder die Schlüssel importieren?";
"attachment_e2e_keys_import" = "Importiere...";
// Contacts
Expand Down Expand Up @@ -251,8 +251,8 @@
"notice_room_withdraw" = "%@ hat %@s Einladung zurückgezogen";
"notice_room_reason" = ". Grund: %@";
"notice_avatar_url_changed" = "%@ hat seinen Avatar geändert";
"notice_display_name_set" = "%@ setzte seinen Anzeigenamen zu %@";
"notice_display_name_changed_from" = "%@ änderte seinen Anzeigenamen von %@ auf %@";
"notice_display_name_set" = "%@ setzte den Anzeigenamen auf %@";
"notice_display_name_changed_from" = "%@ änderte den Anzeigenamen von %@ auf %@";
"notice_display_name_removed" = "%@ hat den Anzeigenamen entfernt";
"notice_topic_changed" = "%@ wechselte das Thema zu: %@";
"notice_room_name_changed" = "%@ änderte den Raum-Namen zu: %@";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
"room_error_cannot_load_timeline" = "Caricamento storico dei messaggi fallito";
"room_error_timeline_event_not_found_title" = "Caricamento della posizione nello storico fallito";
"room_error_timeline_event_not_found" = "L'applicazione ha cercato di caricare un punto specifico dello storico dei messaggi in questo canale, ma non è riuscita a trovarlo";
"room_left" = "Sei uscito dal canale";
"room_left" = "Sei uscito dalla stanza";
"room_no_power_to_create_conference_call" = "Hai bisogno del permesso per invitare a iniziare una conferenza in questo canale";
"room_no_conference_call_in_encrypted_rooms" = "Le chiamate in conferenza non sono supportate nei canali criptati";
// Reply to message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,4 @@
"notification_settings_suppress_from_bots" = "Ogranicz powiadomienia od botów";
"notification_settings_custom_sound" = "Dźwięk niestandardowy";
"login_home_server_info" = "Twój serwer domowy przechowuje wszystkie Twoje rozmowy i dane konta";
"login_user_id_placeholder" = "Matrix ID (np. @bob:matrix.org or bob)";
13 changes: 7 additions & 6 deletions MatrixKit/Controllers/MXKCountryPickerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@
@end

/**
'MXKCountryPickerViewController' instance displays the list of supported countries.
TODO: UISearchDisplayController is deprecated in iOS 8. MXKCountryPickerViewController must use UISearchController to manage the presentation of a search bar and display search results.
'MXKCountryPickerViewController' instance displays the list of supported countries.
*/
@interface MXKCountryPickerViewController : MXKTableViewController <UISearchBarDelegate>
@interface MXKCountryPickerViewController : MXKTableViewController <UISearchResultsUpdating>

@property (weak, nonatomic) IBOutlet UISearchBar *searchBar;
/**
The searchController used to manage search.
*/
@property (nonatomic, strong) UISearchController *searchController;

/**
The delegate for the view controller.
*/
@property (nonatomic) id<MXKCountryPickerViewControllerDelegate> delegate;
@property (nonatomic, weak) id<MXKCountryPickerViewControllerDelegate> delegate;

#pragma mark - Class methods

Expand Down
46 changes: 38 additions & 8 deletions MatrixKit/Controllers/MXKCountryPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ - (void)viewDidLoad
}

self.navigationItem.title = [NSBundle mxk_localizedStringForKey:@"country_picker_title"];

[self setupSearchController];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

if (@available(iOS 11.0, *)) {
self.navigationItem.hidesSearchBarWhenScrolling = YES;
}
}

#pragma mark -
Expand Down Expand Up @@ -136,6 +147,27 @@ - (void)setShowCountryCallingCode:(BOOL)showCountryCallingCode
}
}

#pragma mark - Private

- (void)setupSearchController
{
UISearchController *searchController = [[UISearchController alloc]
initWithSearchResultsController:nil];
searchController.dimsBackgroundDuringPresentation = NO;
searchController.hidesNavigationBarDuringPresentation = NO;
searchController.searchResultsUpdater = self;

if (@available(iOS 11.0, *)) {
self.navigationItem.searchController = searchController;
// Make the search bar visible on first view appearance
self.navigationItem.hidesSearchBarWhenScrolling = NO;
}

self.definesPresentationContext = YES;

self.searchController = searchController;
}

#pragma mark - UITableView dataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
Expand Down Expand Up @@ -215,10 +247,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
}

#pragma mark - UISearchBarDelegate
#pragma mark - UISearchResultsUpdating

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
{
NSString *searchText = searchController.searchBar.text;

if (searchText.length)
{
searchText = [searchText lowercaseString];
Expand Down Expand Up @@ -261,12 +295,8 @@ - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
previousSearchPattern = nil;
filteredCountryNames = nil;
}
}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
previousSearchPattern = nil;
filteredCountryNames = nil;

[self.tableView reloadData];
}

@end
29 changes: 5 additions & 24 deletions MatrixKit/Controllers/MXKCountryPickerViewController.xib
Original file line number Diff line number Diff line change
@@ -1,46 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="MXKCountryPickerViewController">
<connections>
<outlet property="searchBar" destination="crr-l5-sJz" id="a0d-Ne-U2g"/>
<outlet property="searchDisplayController" destination="A2g-v2-wP4" id="Of5-SZ-arM"/>
<outlet property="view" destination="bSe-Sh-aQf" id="4es-L5-nel"/>
</connections>
</placeholder>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="bSe-Sh-aQf">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<searchBar key="tableHeaderView" contentMode="redraw" id="crr-l5-sJz">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<textInputTraits key="textInputTraits"/>
<connections>
<outlet property="delegate" destination="-1" id="fY5-YU-VP4"/>
</connections>
</searchBar>
<connections>
<outlet property="dataSource" destination="-1" id="nhc-tM-1py"/>
<outlet property="delegate" destination="-1" id="9uq-Pc-RpB"/>
</connections>
<point key="canvasLocation" x="-206" y="152"/>
</tableView>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<searchDisplayController id="A2g-v2-wP4">
<connections>
<outlet property="delegate" destination="-1" id="p8n-LM-CZd"/>
<outlet property="searchBar" destination="crr-l5-sJz" id="GGx-dP-Ba3"/>
<outlet property="searchContentsController" destination="-1" id="ptQ-lq-wuM"/>
<outlet property="searchResultsDataSource" destination="-1" id="L0L-zV-jfm"/>
<outlet property="searchResultsDelegate" destination="-1" id="hfY-eA-tMP"/>
</connections>
</searchDisplayController>
</objects>
</document>
11 changes: 6 additions & 5 deletions MatrixKit/Controllers/MXKLanguagePickerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@
/**
'MXKLanguagePickerViewController' instance displays the list of languages.
For the moment, it displays only languages available in the application bundle.
TODO: UISearchDisplayController is deprecated in iOS 8. MXKLanguagePickerViewController must use UISearchController to manage the presentation of a search bar and display search results.
*/
@interface MXKLanguagePickerViewController : MXKTableViewController <UISearchBarDelegate>
@interface MXKLanguagePickerViewController : MXKTableViewController <UISearchResultsUpdating>

@property (unsafe_unretained, nonatomic) IBOutlet UISearchBar *searchBar;
/**
The searchController used to manage search.
*/
@property (nonatomic, strong) UISearchController *searchController;

/**
The delegate for the view controller.
*/
@property (nonatomic) id<MXKLanguagePickerViewControllerDelegate> delegate;
@property (nonatomic, weak) id<MXKLanguagePickerViewControllerDelegate> delegate;

/**
The language marked in the list.
Expand Down
54 changes: 39 additions & 15 deletions MatrixKit/Controllers/MXKLanguagePickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,42 @@ - (void)viewDidLoad
[[[self class] nib] instantiateWithOwner:self options:nil];
}

// Hide search bar for the moment
// TODO: Enable it once we have enough translations to fill pages and pages
[self hideSearchBar:YES];
[self setupSearchController];

self.navigationItem.title = [NSBundle mxk_localizedStringForKey:@"language_picker_title"];

}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

if (@available(iOS 11.0, *)) {
self.navigationItem.hidesSearchBarWhenScrolling = YES;
}
}

- (void)hideSearchBar:(BOOL)hidden
#pragma mark - Private

- (void)setupSearchController
{
self.searchBar.hidden = hidden;
self.tableView.contentInset = UIEdgeInsetsMake(hidden ? -44 : 0, 0, 0 ,0);
[self.view setNeedsUpdateConstraints];
UISearchController *searchController = [[UISearchController alloc]
initWithSearchResultsController:nil];
searchController.dimsBackgroundDuringPresentation = NO;
searchController.hidesNavigationBarDuringPresentation = NO;
searchController.searchResultsUpdater = self;

if (@available(iOS 11.0, *)) {
// Search bar is hidden for the moment, uncomment following line to enable it.
// TODO: Enable it once we have enough translations to fill pages and pages
// self.navigationItem.searchController = searchController;
// Make the search bar visible on first view appearance
self.navigationItem.hidesSearchBarWhenScrolling = NO;
}

self.definesPresentationContext = YES;

self.searchController = searchController;
}

#pragma mark - UITableView dataSource
Expand Down Expand Up @@ -198,6 +222,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else
{
cell.accessoryType = UITableViewCellAccessoryNone;
}
}

return cell;
Expand Down Expand Up @@ -230,10 +258,12 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
}
}

#pragma mark - UISearchBarDelegate
#pragma mark - UISearchResultsUpdating

- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
- (void)updateSearchResultsForSearchController:(UISearchController *)searchController
{
NSString *searchText = searchController.searchBar.text;

if (searchText.length)
{
searchText = [searchText lowercaseString];
Expand Down Expand Up @@ -278,10 +308,4 @@ - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
}
}

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
{
previousSearchPattern = nil;
filteredCellDataArray = nil;
}

@end
Loading

0 comments on commit a8f3e80

Please sign in to comment.