forked from mirrors/linphone-iphone
chat conv create
This commit is contained in:
parent
43e5ea36c3
commit
ff44ab12c1
8 changed files with 475 additions and 73 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
|
|
@ -8,9 +8,10 @@
|
|||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatConversationView">
|
||||
<connections>
|
||||
<outlet property="addressLabel" destination="40" id="43"/>
|
||||
<outlet property="chatView" destination="49" id="54"/>
|
||||
<outlet property="chatView" destination="bJF-qS-vBP" id="AF2-NN-muZ"/>
|
||||
<outlet property="composeIndicatorView" destination="fx4-ao-53M" id="xk5-nK-lur"/>
|
||||
<outlet property="composeLabel" destination="fpY-Fv-ht2" id="4L6-ik-ZAe"/>
|
||||
<outlet property="createChatView" destination="YYI-jh-UPG" id="FIv-GA-Thi"/>
|
||||
<outlet property="editButton" destination="10" id="35"/>
|
||||
<outlet property="messageField" destination="CPp-ts-xy0" id="wPX-Uo-vZQ"/>
|
||||
<outlet property="messageView" destination="14" id="89"/>
|
||||
|
|
@ -86,33 +87,63 @@
|
|||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="49" userLabel="chatView">
|
||||
<view contentMode="scaleToFill" id="49" userLabel="contentView">
|
||||
<rect key="frame" x="0.0" y="44" width="375" height="515"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="8" userLabel="tableView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="418"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<gestureRecognizers/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="29" id="30"/>
|
||||
<outlet property="delegate" destination="29" id="31"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<view contentMode="scaleToFill" id="fx4-ao-53M" userLabel="composeIndicatorView">
|
||||
<rect key="frame" x="0.0" y="426" width="375" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<view contentMode="scaleToFill" id="bJF-qS-vBP" userLabel="chatView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="446"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%@ is composing..." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="fpY-Fv-ht2" userLabel="composeLabel">
|
||||
<rect key="frame" x="0.0" y="1" width="375" height="22"/>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="8" userLabel="messagesTableView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="418"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label=""/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<gestureRecognizers/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="29" id="6U9-NJ-Z7W"/>
|
||||
<outlet property="delegate" destination="29" id="8Lv-aI-a0V"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<view contentMode="scaleToFill" id="fx4-ao-53M" userLabel="composeIndicatorView">
|
||||
<rect key="frame" x="0.0" y="426" width="375" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="%@ is composing..." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" id="fpY-Fv-ht2" userLabel="composeLabel">
|
||||
<rect key="frame" x="0.0" y="1" width="375" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<accessibility key="accessibilityConfiguration" label=""/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="YYI-jh-UPG" userLabel="createChatView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="446"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="none" rowHeight="60" sectionHeaderHeight="22" sectionFooterHeight="22" id="d9Z-ch-tVO" userLabel="addressesTableView">
|
||||
<rect key="frame" x="0.0" y="44" width="375" height="396"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<gestureRecognizers/>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="2fm-IU-Rv8" id="xxn-Q2-doz"/>
|
||||
<outlet property="delegate" destination="2fm-IU-Rv8" id="oHF-Re-HC2"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<searchBar contentMode="redraw" id="vi8-rd-Oiw">
|
||||
<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="2fm-IU-Rv8" id="LA0-Xg-Z9c"/>
|
||||
</connections>
|
||||
</searchBar>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" id="14" userLabel="messageView">
|
||||
<rect key="frame" x="0.0" y="449" width="375" height="66"/>
|
||||
|
|
@ -168,27 +199,42 @@
|
|||
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
|
||||
<point key="canvasLocation" x="235.5" y="366.5"/>
|
||||
</view>
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="tableController" customClass="ChatConversationTableView">
|
||||
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="messagesTableView" customClass="ChatConversationTableView">
|
||||
<extendedEdge key="edgesForExtendedLayout"/>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="8" id="33"/>
|
||||
<outlet property="view" destination="8" id="g4m-ne-lbP"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="639" y="328"/>
|
||||
</tableViewController>
|
||||
<searchDisplayController id="mcs-5Y-d6k">
|
||||
<connections>
|
||||
<outlet property="delegate" destination="2fm-IU-Rv8" id="PRk-2J-XeV"/>
|
||||
<outlet property="searchBar" destination="vi8-rd-Oiw" id="U94-YL-C2I"/>
|
||||
<outlet property="searchContentsController" destination="2fm-IU-Rv8" id="efd-2T-Pof"/>
|
||||
<outlet property="searchResultsDataSource" destination="2fm-IU-Rv8" id="2aO-mr-fU7"/>
|
||||
<outlet property="searchResultsDelegate" destination="2fm-IU-Rv8" id="g0B-zN-bza"/>
|
||||
</connections>
|
||||
</searchDisplayController>
|
||||
<tableViewController id="2fm-IU-Rv8" userLabel="addressesTableView" customClass="ChatConversationSearchTableView">
|
||||
<connections>
|
||||
<outlet property="searchDisplayController" destination="mcs-5Y-d6k" id="uBo-yz-bg2"/>
|
||||
<outlet property="view" destination="d9Z-ch-tVO" id="y6M-se-pTn"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="back.png" width="25" height="22"/>
|
||||
<image name="call_start_body_disabled.png" width="52" height="52"/>
|
||||
<image name="call_start_body_over.png" width="52" height="52"/>
|
||||
<image name="back.png" width="24" height="21"/>
|
||||
<image name="call_start_body_disabled.png" width="51" height="51"/>
|
||||
<image name="call_start_body_over.png" width="51" height="51"/>
|
||||
<image name="chat_picture_default.png" width="25" height="19"/>
|
||||
<image name="chat_picture_over.png" width="42" height="42"/>
|
||||
<image name="chat_send_default.png" width="25" height="24"/>
|
||||
<image name="chat_send_over.png" width="42" height="42"/>
|
||||
<image name="chat_send_default.png" width="40" height="40"/>
|
||||
<image name="chat_send_over.png" width="40" height="40"/>
|
||||
<image name="color_E.png" width="1" height="1"/>
|
||||
<image name="color_F.png" width="1" height="1"/>
|
||||
<image name="edit_list.png" width="31" height="29"/>
|
||||
<image name="status_busy.png" width="28" height="29"/>
|
||||
<image name="edit_list.png" width="29" height="28"/>
|
||||
<image name="status_busy.png" width="27" height="28"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
|
|
|
|||
13
Classes/ChatConversationSearchTableView.h
Normal file
13
Classes/ChatConversationSearchTableView.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// ChatConversationSearchTableView.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 30/09/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface ChatConversationSearchTableView : UITableViewController <UISearchBarDelegate, UISearchDisplayDelegate>
|
||||
|
||||
@end
|
||||
366
Classes/ChatConversationSearchTableView.m
Normal file
366
Classes/ChatConversationSearchTableView.m
Normal file
|
|
@ -0,0 +1,366 @@
|
|||
//
|
||||
// MyTableViewController.m
|
||||
// UISearchDisplayController
|
||||
//
|
||||
// Created by Phillip Harris on 4/19/14.
|
||||
// Copyright (c) 2014 Phillip Harris. All rights reserved.
|
||||
//
|
||||
|
||||
#import "ChatConversationSearchTableView.h"
|
||||
|
||||
@interface ChatConversationSearchTableView ()
|
||||
|
||||
@property(nonatomic, strong) NSArray *names;
|
||||
@property(nonatomic, strong) NSArray *searchResults;
|
||||
@property(nonatomic, strong) UISearchDisplayController *searchController;
|
||||
|
||||
@end
|
||||
|
||||
@implementation ChatConversationSearchTableView
|
||||
|
||||
//===============================================
|
||||
#pragma mark -
|
||||
#pragma mark Initialization
|
||||
//===============================================
|
||||
|
||||
- (id)initWithStyle:(UITableViewStyle)style {
|
||||
self = [super initWithStyle:style];
|
||||
if (self) {
|
||||
[self commonInit];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)coder {
|
||||
self = [super initWithCoder:coder];
|
||||
if (self) {
|
||||
[self commonInit];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)commonInit {
|
||||
_names = @[
|
||||
@"Aaliyah",
|
||||
@"Aaron",
|
||||
@"Abigail",
|
||||
@"Adam",
|
||||
@"Addison",
|
||||
@"Adrian",
|
||||
@"Aiden",
|
||||
@"Alex",
|
||||
@"Alexa",
|
||||
@"Alexander",
|
||||
@"Alexandra",
|
||||
@"Alexis",
|
||||
@"Allison",
|
||||
@"Alyssa",
|
||||
@"Amelia",
|
||||
@"Andrea",
|
||||
@"Andrew",
|
||||
@"Angel",
|
||||
@"Anna",
|
||||
@"Annabelle",
|
||||
@"Anthony",
|
||||
@"Aria",
|
||||
@"Ariana",
|
||||
@"Arianna",
|
||||
@"Ashley",
|
||||
@"Aubree",
|
||||
@"Aubrey",
|
||||
@"Audrey",
|
||||
@"Austin",
|
||||
@"Autumn",
|
||||
@"Ava",
|
||||
@"Avery",
|
||||
@"Ayden",
|
||||
@"Bailey",
|
||||
@"Bella",
|
||||
@"Benjamin",
|
||||
@"Bentley",
|
||||
@"Blake",
|
||||
@"Brandon",
|
||||
@"Brayden",
|
||||
@"Brianna",
|
||||
@"Brody",
|
||||
@"Brooklyn",
|
||||
@"Bryson",
|
||||
@"Caleb",
|
||||
@"Cameron",
|
||||
@"Camila",
|
||||
@"Carlos",
|
||||
@"Caroline",
|
||||
@"Carson",
|
||||
@"Carter",
|
||||
@"Charles",
|
||||
@"Charlotte",
|
||||
@"Chase",
|
||||
@"Chloe",
|
||||
@"Christian",
|
||||
@"Christopher",
|
||||
@"Claire",
|
||||
@"Colton",
|
||||
@"Connor",
|
||||
@"Cooper",
|
||||
@"Damian",
|
||||
@"Daniel",
|
||||
@"David",
|
||||
@"Dominic",
|
||||
@"Dylan",
|
||||
@"Easton",
|
||||
@"Eli",
|
||||
@"Elijah",
|
||||
@"Elizabeth",
|
||||
@"Ella",
|
||||
@"Ellie",
|
||||
@"Emily",
|
||||
@"Emma",
|
||||
@"Ethan",
|
||||
@"Eva",
|
||||
@"Evan",
|
||||
@"Evelyn",
|
||||
@"Faith",
|
||||
@"Gabriel",
|
||||
@"Gabriella",
|
||||
@"Gavin",
|
||||
@"Genesis",
|
||||
@"Gianna",
|
||||
@"Grace",
|
||||
@"Grayson",
|
||||
@"Hailey",
|
||||
@"Hannah",
|
||||
@"Harper",
|
||||
@"Henry",
|
||||
@"Hudson",
|
||||
@"Hunter",
|
||||
@"Ian",
|
||||
@"Isaac",
|
||||
@"Isabella",
|
||||
@"Isaiah",
|
||||
@"Jace",
|
||||
@"Jack",
|
||||
@"Jackson",
|
||||
@"Jacob",
|
||||
@"James",
|
||||
@"Jasmine",
|
||||
@"Jason",
|
||||
@"Jaxon",
|
||||
@"Jayden",
|
||||
@"Jeremiah",
|
||||
@"Jocelyn",
|
||||
@"John",
|
||||
@"Jonathan",
|
||||
@"Jordan",
|
||||
@"Jose",
|
||||
@"Joseph",
|
||||
@"Joshua",
|
||||
@"Josiah",
|
||||
@"Juan",
|
||||
@"Julia",
|
||||
@"Julian",
|
||||
@"Justin",
|
||||
@"Katherine",
|
||||
@"Kayden",
|
||||
@"Kayla",
|
||||
@"Kaylee",
|
||||
@"Kennedy",
|
||||
@"Kevin",
|
||||
@"Khloe",
|
||||
@"Kimberly",
|
||||
@"Kylie",
|
||||
@"Landon",
|
||||
@"Lauren",
|
||||
@"Layla",
|
||||
@"Leah",
|
||||
@"Levi",
|
||||
@"Liam",
|
||||
@"Lillian",
|
||||
@"Lily",
|
||||
@"Logan",
|
||||
@"London",
|
||||
@"Lucas",
|
||||
@"Lucy",
|
||||
@"Luis",
|
||||
@"Luke",
|
||||
@"Lydia",
|
||||
@"Mackenzie",
|
||||
@"Madeline",
|
||||
@"Madelyn",
|
||||
@"Madison",
|
||||
@"Makayla",
|
||||
@"Mason",
|
||||
@"Matthew",
|
||||
@"Maya",
|
||||
@"Melanie",
|
||||
@"Mia",
|
||||
@"Michael",
|
||||
@"Molly",
|
||||
@"Morgan",
|
||||
@"Naomi",
|
||||
@"Natalie",
|
||||
@"Nathan",
|
||||
@"Nathaniel",
|
||||
@"Nevaeh",
|
||||
@"Nicholas",
|
||||
@"Noah",
|
||||
@"Nolan",
|
||||
@"Oliver",
|
||||
@"Olivia",
|
||||
@"Owen",
|
||||
@"Parker",
|
||||
@"Peyton",
|
||||
@"Piper",
|
||||
@"Reagan",
|
||||
@"Riley",
|
||||
@"Robert",
|
||||
@"Ryan",
|
||||
@"Ryder",
|
||||
@"Samantha",
|
||||
@"Samuel",
|
||||
@"Sarah",
|
||||
@"Savannah",
|
||||
@"Scarlett",
|
||||
@"Sebastian",
|
||||
@"Serenity",
|
||||
@"Skylar",
|
||||
@"Sofia",
|
||||
@"Sophia",
|
||||
@"Sophie",
|
||||
@"Stella",
|
||||
@"Sydney",
|
||||
@"Taylor",
|
||||
@"Thomas",
|
||||
@"Trinity",
|
||||
@"Tristan",
|
||||
@"Tyler",
|
||||
@"Victoria",
|
||||
@"Violet",
|
||||
@"William",
|
||||
@"Wyatt",
|
||||
@"Xavier",
|
||||
@"Zachary",
|
||||
@"Zoe",
|
||||
@"Zoey"
|
||||
];
|
||||
}
|
||||
|
||||
//===============================================
|
||||
#pragma mark -
|
||||
#pragma mark View Methods
|
||||
//===============================================
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self configureTableView:self.tableView];
|
||||
}
|
||||
|
||||
//===============================================
|
||||
#pragma mark -
|
||||
#pragma mark Helper
|
||||
//===============================================
|
||||
|
||||
- (void)configureTableView:(UITableView *)tableView {
|
||||
|
||||
tableView.separatorInset = UIEdgeInsetsZero;
|
||||
|
||||
[tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cellId"];
|
||||
|
||||
UIView *tableFooterViewToGetRidOfBlankRows = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
tableFooterViewToGetRidOfBlankRows.backgroundColor = [UIColor clearColor];
|
||||
tableView.tableFooterView = tableFooterViewToGetRidOfBlankRows;
|
||||
}
|
||||
|
||||
//===============================================
|
||||
#pragma mark -
|
||||
#pragma mark UITableView
|
||||
//===============================================
|
||||
|
||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
|
||||
if (tableView == self.tableView) {
|
||||
return [self.names count];
|
||||
} else {
|
||||
return [self.searchResults count];
|
||||
}
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellId" forIndexPath:indexPath];
|
||||
|
||||
NSString *name = (tableView == self.tableView) ? self.names[indexPath.row] : self.searchResults[indexPath.row];
|
||||
|
||||
cell.textLabel.text = name;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
//===============================================
|
||||
#pragma mark -
|
||||
#pragma mark UISearchDisplayDelegate
|
||||
//===============================================
|
||||
|
||||
- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
|
||||
NSLog(@"🔦 | will begin search");
|
||||
}
|
||||
- (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller {
|
||||
NSLog(@"🔦 | did begin search");
|
||||
}
|
||||
- (void)searchDisplayControllerWillEndSearch:(UISearchDisplayController *)controller {
|
||||
NSLog(@"🔦 | will end search");
|
||||
}
|
||||
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller {
|
||||
NSLog(@"🔦 | did end search");
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
didLoadSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | did load table");
|
||||
[self configureTableView:tableView];
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
willUnloadSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | will unload table");
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
willShowSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | will show table");
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
didShowSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | did show table");
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
willHideSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | will hide table");
|
||||
}
|
||||
- (void)searchDisplayController:(UISearchDisplayController *)controller
|
||||
didHideSearchResultsTableView:(UITableView *)tableView {
|
||||
NSLog(@"🔦 | did hide table");
|
||||
}
|
||||
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
|
||||
shouldReloadTableForSearchString:(NSString *)searchString {
|
||||
NSLog(@"🔦 | should reload table for search string?");
|
||||
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@", searchString];
|
||||
self.searchResults = [self.names filteredArrayUsingPredicate:predicate];
|
||||
|
||||
return YES;
|
||||
}
|
||||
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller
|
||||
shouldReloadTableForSearchScope:(NSInteger)searchOption {
|
||||
NSLog(@"🔦 | should reload table for search scope?");
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -48,8 +48,8 @@
|
|||
@property(nonatomic, strong) IBOutlet UISwipeGestureRecognizer *listSwipeGestureRecognizer;
|
||||
@property(strong, nonatomic) IBOutlet UILabel *composeLabel;
|
||||
@property(strong, nonatomic) IBOutlet UIView *composeIndicatorView;
|
||||
|
||||
@property(nonatomic, strong) IBOutlet UIButton *pictureButton;
|
||||
@property(weak, nonatomic) IBOutlet UIView *createChatView;
|
||||
|
||||
- (IBAction)onBackClick:(id)event;
|
||||
- (IBAction)onEditClick:(id)event;
|
||||
|
|
|
|||
|
|
@ -163,12 +163,18 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
chatRoom = room;
|
||||
[messageField setText:@""];
|
||||
[tableController setChatRoom:room];
|
||||
|
||||
if (chatRoom != NULL) {
|
||||
_createChatView.hidden = YES;
|
||||
chatView.hidden = NO;
|
||||
[self update];
|
||||
linphone_chat_room_mark_as_read(chatRoom);
|
||||
[self setComposingVisible:linphone_chat_room_is_remote_composing(chatRoom) withDelay:0];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self];
|
||||
} else {
|
||||
_createChatView.hidden = NO;
|
||||
chatView.hidden = YES;
|
||||
}
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMessageReceived object:self];
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(NSNotification *)notif {
|
||||
|
|
|
|||
|
|
@ -24,12 +24,11 @@
|
|||
#import "ChatsListTableView.h"
|
||||
#import "UICompositeView.h"
|
||||
|
||||
@interface ChatsListView : UIViewController <UITextFieldDelegate, UICompositeViewDelegate> {
|
||||
@interface ChatsListView : UIViewController <UICompositeViewDelegate> {
|
||||
}
|
||||
|
||||
@property(nonatomic, strong) IBOutlet ChatsListTableView *tableController;
|
||||
@property(nonatomic, strong) IBOutlet UIButton *editButton;
|
||||
@property(nonatomic, strong) IBOutlet UITextField *addressField;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *toggleSelectionButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *backButton;
|
||||
@property(weak, nonatomic) IBOutlet UIButton *addButton;
|
||||
|
|
|
|||
|
|
@ -73,36 +73,10 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
#pragma mark - Action Functions
|
||||
|
||||
- (void)startChatRoom {
|
||||
// Push ChatRoom
|
||||
LinphoneChatRoom *room =
|
||||
linphone_core_get_chat_room_from_uri([LinphoneManager getLc], [_addressField.text UTF8String]);
|
||||
if (room != nil) {
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setChatRoom:room];
|
||||
} else {
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid address", nil)
|
||||
message:@"Please specify the entire SIP address for the chat"
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Cancel", nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
}
|
||||
_addressField.text = @"";
|
||||
}
|
||||
|
||||
- (IBAction)onAddClick:(id)event {
|
||||
if (_addressField.text.length == 0) { // if no address is manually set, lauch address book
|
||||
[ContactSelection setSelectionMode:ContactSelectionModeMessage];
|
||||
[ContactSelection setAddAddress:nil];
|
||||
[ContactSelection setSipFilter:[LinphoneManager instance].contactFilter];
|
||||
[ContactSelection enableEmailFilter:FALSE];
|
||||
[ContactSelection setNameOrEmailFilter:nil];
|
||||
[PhoneMainView.instance changeCurrentView:ContactsListView.compositeViewDescription push:TRUE];
|
||||
} else {
|
||||
[self startChatRoom];
|
||||
}
|
||||
ChatConversationView *view = VIEW(ChatConversationView);
|
||||
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription push:TRUE];
|
||||
[view setChatRoom:NULL];
|
||||
}
|
||||
|
||||
- (void)setEditing:(BOOL)editing {
|
||||
|
|
@ -118,12 +92,4 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
- (IBAction)onSelectionToggle:(id)sender {
|
||||
}
|
||||
|
||||
#pragma mark - UITextFieldDelegate Functions
|
||||
|
||||
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
|
||||
[_addressField resignFirstResponder];
|
||||
if (_addressField.text.length > 0)
|
||||
[self startChatRoom];
|
||||
return YES;
|
||||
}
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@
|
|||
633756391B67BAF400E21BAD /* SideMenuTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 633756381B67BAF400E21BAD /* SideMenuTableView.m */; };
|
||||
633756451B67D2B200E21BAD /* SideMenuView.m in Sources */ = {isa = PBXBuildFile; fileRef = 633756431B67D2B100E21BAD /* SideMenuView.m */; };
|
||||
633756461B67D2B200E21BAD /* SideMenuView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 633756441B67D2B100E21BAD /* SideMenuView.xib */; };
|
||||
6341807C1BBC103100F71761 /* ChatConversationSearchTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6341807B1BBC103100F71761 /* ChatConversationSearchTableView.m */; };
|
||||
634610061B61330300548952 /* UILabel+Boldify.m in Sources */ = {isa = PBXBuildFile; fileRef = 634610051B61330300548952 /* UILabel+Boldify.m */; };
|
||||
6346100F1B61409800548952 /* CallOutgoingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6346100E1B61409800548952 /* CallOutgoingView.m */; };
|
||||
634610121B6140A500548952 /* CallOutgoingView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 634610101B6140A500548952 /* CallOutgoingView.xib */; };
|
||||
|
|
@ -704,6 +705,8 @@
|
|||
633756431B67D2B100E21BAD /* SideMenuView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SideMenuView.m; sourceTree = "<group>"; };
|
||||
633756441B67D2B100E21BAD /* SideMenuView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SideMenuView.xib; sourceTree = "<group>"; };
|
||||
633E388219FFB0F400936D1C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
|
||||
6341807A1BBC103100F71761 /* ChatConversationSearchTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatConversationSearchTableView.h; sourceTree = "<group>"; };
|
||||
6341807B1BBC103100F71761 /* ChatConversationSearchTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatConversationSearchTableView.m; sourceTree = "<group>"; };
|
||||
634610041B61330300548952 /* UILabel+Boldify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UILabel+Boldify.h"; sourceTree = "<group>"; };
|
||||
634610051B61330300548952 /* UILabel+Boldify.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UILabel+Boldify.m"; sourceTree = "<group>"; };
|
||||
6346100D1B61409800548952 /* CallOutgoingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallOutgoingView.h; sourceTree = "<group>"; };
|
||||
|
|
@ -1350,6 +1353,8 @@
|
|||
D3F83EE91582021700336684 /* CallView.h */,
|
||||
D3F83EEA1582021700336684 /* CallView.m */,
|
||||
D381881C15FE3FCA00C3EDCA /* CallView.xib */,
|
||||
6341807A1BBC103100F71761 /* ChatConversationSearchTableView.h */,
|
||||
6341807B1BBC103100F71761 /* ChatConversationSearchTableView.m */,
|
||||
D32B6E2715A5BC430033019F /* ChatConversationTableView.h */,
|
||||
D32B6E2815A5BC430033019F /* ChatConversationTableView.m */,
|
||||
D3F795D315A582800077328B /* ChatConversationView.h */,
|
||||
|
|
@ -2646,6 +2651,7 @@
|
|||
D3549816158761D0000081D8 /* ContactsListTableView.m in Sources */,
|
||||
D35498211587716B000081D8 /* StatusBarView.m in Sources */,
|
||||
D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */,
|
||||
6341807C1BBC103100F71761 /* ChatConversationSearchTableView.m in Sources */,
|
||||
D326483815887D5200930C67 /* OrderedDictionary.m in Sources */,
|
||||
D32648441588F6FC00930C67 /* UIToggleButton.m in Sources */,
|
||||
D36FB2D51589EF7C0036F6F2 /* UIPauseButton.m in Sources */,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue