UI: add back to call icon

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-26 12:15:38 +01:00
parent 30a168c2e1
commit 01e9bc3310
14 changed files with 141 additions and 21 deletions

View file

@ -594,6 +594,9 @@
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="highlighted" backgroundImage="color_L.png"/>
<connections>
<action selector="onChatClick:" destination="-1" eventType="touchUpInside" id="Jdk-1s-UnN"/>
</connections>
</button>
</subviews>
</view>

View file

@ -9,6 +9,7 @@
<connections>
<outlet property="addressLabel" destination="40" id="43"/>
<outlet property="backButton" destination="9" id="9Pw-ZA-KcF"/>
<outlet property="backToCallButton" destination="Hc0-GX-fC5" id="pYe-gN-Z64"/>
<outlet property="callButton" destination="Wzg-i0-spp" id="w9L-aT-1AD"/>
<outlet property="chatView" destination="bJF-qS-vBP" id="AF2-NN-muZ"/>
<outlet property="composeIndicatorView" destination="fx4-ao-53M" id="xk5-nK-lur"/>
@ -74,6 +75,17 @@
<action selector="onCallClick:" destination="-1" eventType="touchUpInside" id="Dsf-nS-K3V"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Hc0-GX-fC5" userLabel="backToCallButton" customClass="UIBackToCallButton">
<rect key="frame" x="225" y="0.0" width="75" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="call_alt_back_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_alt_back_disabled.png"/>
<connections>
<action selector="onBackToCallClick:" destination="-2" eventType="touchUpInside" id="bOG-ra-UpM"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Wag-Nx-kd6" userLabel="deleteButton" customClass="UIIconButton">
<rect key="frame" x="300" y="0.0" width="75" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -225,7 +237,7 @@
</subviews>
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina47"/>
<point key="canvasLocation" x="235.5" y="366.5"/>
<point key="canvasLocation" x="228.5" y="-40.5"/>
</view>
<tableViewController autoresizesArchivedViewToFullSize="NO" id="29" userLabel="messagesTableView" customClass="ChatConversationTableView">
<extendedEdge key="edgesForExtendedLayout"/>
@ -243,6 +255,8 @@
<resources>
<image name="back_default.png" width="24" height="21"/>
<image name="back_disabled.png" width="24" height="21"/>
<image name="call_alt_back_default.png" width="50" height="36"/>
<image name="call_alt_back_disabled.png" width="50" height="36"/>
<image name="call_alt_start_default.png" width="29" height="29"/>
<image name="call_alt_start_disabled.png" width="29" height="29"/>
<image name="cancel_edit_default.png" width="29" height="29"/>

View file

@ -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="14F27" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
@ -8,6 +8,7 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ChatsListView">
<connections>
<outlet property="addButton" destination="Z5G-IF-PBY" id="Tzw-rz-Bwe"/>
<outlet property="backToCallButton" destination="Fac-hy-za4" id="8I3-TM-oJ7"/>
<outlet property="tableController" destination="4" id="18"/>
<outlet property="view" destination="5" id="14"/>
</connections>
@ -88,6 +89,17 @@
<action selector="onEditionChangeClick:" destination="-1" eventType="touchUpInside" id="e2C-A0-kjU"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="Fac-hy-za4" userLabel="backToCallButton" customClass="UIBackToCallButton">
<rect key="frame" x="225" y="1" width="75" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" image="call_alt_back_default.png">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="disabled" image="call_alt_back_disabled.png"/>
<connections>
<action selector="onBackToCallClick:" destination="-2" eventType="touchUpInside" id="eUD-Gk-qji"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="Z5G-IF-PBY" userLabel="addButton">
<rect key="frame" x="0.0" y="0.0" width="75" height="42"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
@ -135,12 +147,14 @@
</tableViewController>
</objects>
<resources>
<image name="call_alt_back_default.png" width="50" height="36"/>
<image name="call_alt_back_disabled.png" width="50" height="36"/>
<image name="cancel_edit_default.png" width="29" height="29"/>
<image name="cancel_edit_disabled.png" width="29" height="29"/>
<image name="chat_add_default.png" width="32" height="29"/>
<image name="chat_add_disabled.png" width="32" height="29"/>
<image name="color_E.png" width="1" height="1"/>
<image name="color_F.png" width="1" height="1"/>
<image name="color_E.png" width="2" height="2"/>
<image name="color_F.png" width="2" height="2"/>
<image name="delete_default.png" width="21" height="27"/>
<image name="delete_disabled.png" width="21" height="27"/>
<image name="deselect_all_default.png" width="26" height="26"/>

View file

@ -100,5 +100,6 @@
- (IBAction)onOptionsAddClick:(id)sender;
- (IBAction)onOptionsConferenceClick:(id)sender;
- (IBAction)onNumpadClick:(id)sender;
- (IBAction)onChatClick:(id)sender;
@end

View file

@ -759,6 +759,11 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
}
}
- (IBAction)onChatClick:(id)sender {
ChatsListView *view = VIEW(ChatsListView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
- (IBAction)onRoutesBluetoothClick:(id)sender {
[self hideRoutes:TRUE];
[[LinphoneManager instance] setBluetoothEnabled:TRUE];

View file

@ -25,6 +25,7 @@
#import "ImagePickerView.h"
#import "OrderedDictionary.h"
#import "UIRoundedImageView.h"
#import "UIBackToCallButton.h"
#include "linphone/linphonecore.h"
@ -52,6 +53,7 @@
@property(nonatomic, strong) IBOutlet UIButton *pictureButton;
@property(weak, nonatomic) IBOutlet UIIconButton *backButton;
@property(weak, nonatomic) IBOutlet UIIconButton *callButton;
@property(weak, nonatomic) IBOutlet UIBackToCallButton *backToCallButton;
- (IBAction)onBackClick:(id)event;
- (IBAction)onEditClick:(id)event;

View file

@ -108,6 +108,10 @@ static UICompositeViewDescription *compositeDescription = nil;
selector:@selector(textComposeEvent:)
name:kLinphoneTextComposeEvent
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
if ([_tableController isEditing])
[_tableController setEditing:FALSE animated:FALSE];
@ -116,6 +120,9 @@ static UICompositeViewDescription *compositeDescription = nil;
BOOL fileSharingEnabled = linphone_core_get_file_transfer_server([LinphoneManager getLc]) != NULL;
[_pictureButton setEnabled:fileSharingEnabled];
[self callUpdateEvent:nil];
[_backToCallButton update];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -167,6 +174,10 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
- (void)callUpdateEvent:(NSNotification *)notif {
_callButton.hidden = linphone_core_get_current_call([LinphoneManager getLc]);
}
- (void)update {
if (chatRoom == NULL) {
LOGW(@"Cannot update chat room header: null contact");
@ -437,16 +448,6 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
[_messageField resignFirstResponder];
}
- (IBAction)onCallClick:(id)sender {
NSString *displayName = [FastAddressBook displayNameForAddress:linphone_chat_room_get_peer_address(chatRoom)];
// Go to dialer view
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
char *uri = linphone_address_as_string(linphone_chat_room_get_peer_address(chatRoom));
[view call:[NSString stringWithUTF8String:uri] displayName:displayName];
ms_free(uri);
}
- (IBAction)onDeleteClick:(id)sender {
NSString *msg =
[NSString stringWithFormat:NSLocalizedString(@"Are you sure that you want to delete %d messages?", nil),
@ -466,6 +467,16 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st
_backButton.hidden = _callButton.hidden = _tableController.isEditing;
}
- (IBAction)onCallClick:(id)sender {
NSString *displayName = [FastAddressBook displayNameForAddress:linphone_chat_room_get_peer_address(chatRoom)];
// Go to dialer view
DialerView *view = VIEW(DialerView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
char *uri = linphone_address_as_string(linphone_chat_room_get_peer_address(chatRoom));
[view call:[NSString stringWithUTF8String:uri] displayName:displayName];
ms_free(uri);
}
- (IBAction)onListSwipe:(id)sender {
[self onBackClick:sender];
}

View file

@ -23,12 +23,14 @@
#import "ChatsListTableView.h"
#import "UICompositeView.h"
#import "UIBackToCallButton.h"
@interface ChatsListView : UIViewController <UICompositeViewDelegate> {
}
@property(nonatomic, strong) IBOutlet ChatsListTableView *tableController;
@property(weak, nonatomic) IBOutlet UIButton *addButton;
@property(weak, nonatomic) IBOutlet UIBackToCallButton *backToCallButton;
- (IBAction)onAddClick:(id)event;
- (IBAction)onEditionChangeClick:(id)sender;

View file

@ -32,6 +32,7 @@
name:kLinphoneMessageReceived
object:nil];
[self setEditing:NO];
[_backToCallButton update];
}
- (void)viewWillDisappear:(BOOL)animated {
@ -92,5 +93,4 @@ static UICompositeViewDescription *compositeDescription = nil;
}];
}
@end

View file

@ -0,0 +1,16 @@
//
// UIBackToCallButton.h
// linphone
//
// Created by Gautier Pelloux-Prayer on 26/10/15.
//
//
#import "UIIconButton.h"
@interface UIBackToCallButton : UIIconButton
- (IBAction)onBackToCallClick:(id)sender;
- (void)update;
@end

View file

@ -0,0 +1,42 @@
//
// UIBackToCallButton.m
// linphone
//
// Created by Gautier Pelloux-Prayer on 26/10/15.
//
//
#import "UIBackToCallButton.h"
#import "LinphoneManager.h"
#import "PhoneMainView.h"
@implementation UIBackToCallButton
- (instancetype)init {
if (self = [super init]) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(callUpdateEvent:)
name:kLinphoneCallUpdate
object:nil];
}
return self;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (void)callUpdateEvent:(NSNotification *)notif {
[self update];
}
- (void)update {
self.hidden = (linphone_core_get_current_call([LinphoneManager getLc]) == NULL);
}
- (IBAction)onBackToCallClick:(id)sender {
CallView *view = VIEW(CallView);
[PhoneMainView.instance changeCurrentView:view.compositeViewDescription];
}
@end

View file

@ -66,7 +66,7 @@
}
const LinphoneAddress *addr = linphone_chat_room_get_peer_address(chatRoom);
[ContactDisplay setDisplayNameLabel:_addressLabel forAddress:addr];
[_avatarImage setImage:[FastAddressBook imageForAddress:addr thumbnail:NO] bordered:YES withRoundedRadius:YES];
[_avatarImage setImage:[FastAddressBook imageForAddress:addr thumbnail:YES] bordered:NO withRoundedRadius:YES];
LinphoneChatMessage *last_message = linphone_chat_room_get_user_data(chatRoom);
if (last_message) {

View file

@ -348,11 +348,15 @@ static RootViewManager *rootViewManagerInstance = nil;
case LinphoneCallEnd: {
const MSList *calls = linphone_core_get_calls([LinphoneManager getLc]);
if (calls == NULL) {
// Go to dialer view
DialerView *view = VIEW(DialerView);
[self changeCurrentView:view.compositeViewDescription];
[view setAddress:@""];
[view setTransferMode:FALSE];
if ((currentView == CallView.compositeViewDescription) ||
(currentView == CallIncomingView.compositeViewDescription) ||
(currentView == CallOutgoingView.compositeViewDescription)) {
// Go to dialer view
DialerView *view = VIEW(DialerView);
[self changeCurrentView:view.compositeViewDescription];
[view setAddress:@""];
[view setTransferMode:FALSE];
}
} else {
linphone_core_resume_call([LinphoneManager getLc], (LinphoneCall *)calls->data);
[self changeCurrentView:CallView.compositeViewDescription];

View file

@ -109,6 +109,7 @@
63701DDF1BA32039006A9AE3 /* UIConfirmationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 63701DDE1BA32039006A9AE3 /* UIConfirmationDialog.m */; };
637144571BD531CE007E7C06 /* UIContactDetailsCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 637144561BD531CE007E7C06 /* UIContactDetailsCell.xib */; };
637157A11B283FE200C91677 /* FileTransferDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 637157A01B283FE200C91677 /* FileTransferDelegate.m */; };
6377AC801BDE4069007F7625 /* UIBackToCallButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 6377AC7F1BDE4069007F7625 /* UIBackToCallButton.m */; };
637D9FD21BD9104100A81059 /* add_field_default.png in Resources */ = {isa = PBXBuildFile; fileRef = 637D9EF71BD9104000A81059 /* add_field_default.png */; };
637D9FD31BD9104100A81059 /* add_field_over.png in Resources */ = {isa = PBXBuildFile; fileRef = 637D9EF81BD9104000A81059 /* add_field_over.png */; };
637D9FD41BD9104100A81059 /* avatar.png in Resources */ = {isa = PBXBuildFile; fileRef = 637D9EF91BD9104000A81059 /* avatar.png */; };
@ -775,6 +776,8 @@
637144561BD531CE007E7C06 /* UIContactDetailsCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIContactDetailsCell.xib; sourceTree = "<group>"; };
6371579F1B283FE200C91677 /* FileTransferDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileTransferDelegate.h; path = Utils/FileTransferDelegate.h; sourceTree = "<group>"; };
637157A01B283FE200C91677 /* FileTransferDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FileTransferDelegate.m; path = Utils/FileTransferDelegate.m; sourceTree = "<group>"; };
6377AC7E1BDE4068007F7625 /* UIBackToCallButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIBackToCallButton.h; sourceTree = "<group>"; };
6377AC7F1BDE4069007F7625 /* UIBackToCallButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIBackToCallButton.m; sourceTree = "<group>"; };
637D9EF71BD9104000A81059 /* add_field_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = add_field_default.png; sourceTree = "<group>"; };
637D9EF81BD9104000A81059 /* add_field_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = add_field_over.png; sourceTree = "<group>"; };
637D9EF91BD9104000A81059 /* avatar.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = avatar.png; sourceTree = "<group>"; };
@ -1614,6 +1617,8 @@
D3196D3D15A32BD8007FEEBA /* UITransferButton.m */,
340751E5150F38FC00B89C47 /* UIVideoButton.h */,
340751E6150F38FD00B89C47 /* UIVideoButton.m */,
6377AC7E1BDE4068007F7625 /* UIBackToCallButton.h */,
6377AC7F1BDE4069007F7625 /* UIBackToCallButton.m */,
);
path = LinphoneUI;
sourceTree = "<group>";
@ -2820,6 +2825,7 @@
D3F83EEC1582021700336684 /* CallView.m in Sources */,
63F1DF4B1BCE983200EDED90 /* CallConferenceTableView.m in Sources */,
D3F83F8E15822ABE00336684 /* PhoneMainView.m in Sources */,
6377AC801BDE4069007F7625 /* UIBackToCallButton.m in Sources */,
D3ED3E871586291E006C0DE4 /* TabBarView.m in Sources */,
D3ED3EA71587334E006C0DE4 /* HistoryListTableView.m in Sources */,
D3ED3EB81587392C006C0DE4 /* HistoryListView.m in Sources */,