UI: various minor fixes

This commit is contained in:
Gautier Pelloux-Prayer 2015-10-14 13:07:33 +02:00
parent b73ab96def
commit 72031e0ea3
14 changed files with 112 additions and 29 deletions

View file

@ -7,7 +7,6 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CallView">
<connections>
<outlet property="addressLabel" destination="8bV-K4-3TY" id="aqZ-1x-isL"/>
<outlet property="avatarImage" destination="fZy-K5-yQp" id="hOl-IQ-c9B"/>
<outlet property="callView" destination="9" id="TKY-dp-lKv"/>
<outlet property="durationLabel" destination="Oy8-QO-Jwb" id="mUT-TX-gLp"/>
@ -70,13 +69,6 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="503"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="john.doe@sip.linphone.org" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="8" id="8bV-K4-3TY" userLabel="addressLabel">
<rect key="frame" x="90" y="241" width="194" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="1" green="0.36862745099999999" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" tag="7" contentMode="scaleAspectFit" image="avatar.png" id="fZy-K5-yQp" userLabel="avatarImage" customClass="UIRoundedImageView">
<rect key="frame" x="46" y="110" width="283" height="283"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
@ -86,7 +78,7 @@
</accessibility>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="John Doe" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="19" id="KPa-Rm-Qni" userLabel="nameLabel">
<rect key="frame" x="46" y="236" width="283" height="32"/>
<rect key="frame" x="46" y="400" width="283" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="37"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
@ -117,7 +109,7 @@
</accessibility>
</view>
<view contentMode="scaleAspectFit" id="127" userLabel="preview">
<rect key="frame" x="254" y="354.99999934763446" width="113" height="140"/>
<rect key="frame" x="254.00000029960563" y="355" width="113" height="140"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" heightSizable="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
@ -144,7 +136,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<button opaque="NO" tag="24" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="7f5-7T-fV3" userLabel="pauseButton" customClass="UIPauseButton">
<rect key="frame" x="293" y="50" width="52" height="52"/>
<rect key="frame" x="310" y="370" width="52" height="52"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
<accessibility key="accessibilityConfiguration" label="Pause"/>
<state key="normal" image="pause_big_default.png">

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" 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="8154"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DialerView">
@ -46,7 +46,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="66"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</imageView>
<textField opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter SIP address or phone number" minimumFontSize="5" id="4" userLabel="addressField">
<textField opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Enter SIP address or phone number" minimumFontSize="5" id="4" userLabel="addressField" customClass="UIAddressTextField">
<rect key="frame" x="0.0" y="0.0" width="312" height="63"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" heightSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
@ -54,7 +54,7 @@
<fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="36"/>
<textInputTraits key="textInputTraits" autocorrectionType="no" keyboardType="alphabet"/>
<connections>
<action selector="onAddressChange:" destination="-1" eventType="editingChanged" id="208"/>
<action selector="onAddressChange:" destination="-1" eventType="editingChanged" id="FdS-Kl-3dS"/>
<outlet property="delegate" destination="-1" id="190"/>
</connections>
</textField>
@ -328,4 +328,9 @@
<image name="numpad_sharp.png" width="53" height="50"/>
<image name="numpad_star.png" width="52" height="50"/>
</resources>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -121,6 +121,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self hideOptions:FALSE];
[self hidePad:FALSE];
[self showSpeaker];
[self callDurationUpdate];
// Set windows (warn memory leaks)
linphone_core_set_native_video_window_id([LinphoneManager getLc], (__bridge void *)(_videoView));
@ -145,6 +146,12 @@ static UICompositeViewDescription *compositeDescription = nil;
ms_free(uri);
_avatarImage.image =
[FastAddressBook getContactImage:[FastAddressBook getContactWithLinphoneAddress:addr] thumbnail:NO];
[NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(callDurationUpdate)
userInfo:nil
repeats:YES];
}
- (void)viewDidDisappear:(BOOL)animated {
@ -525,6 +532,14 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
#pragma mark - UI modification
- (void)callDurationUpdate {
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
int duration = linphone_call_get_duration(call);
_durationLabel.text = [NSString stringWithFormat:@"%02i:%02i", (duration / 60), (duration % 60)];
}
}
- (void)showPad:(BOOL)animated {
[_numpadButton setOn];
if ([_numpadView isHidden]) {

View file

@ -397,6 +397,7 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - Action Functions
- (IBAction)onAddContactClick:(id)event {
[ContactSelection setSelectionMode:ContactSelectionModeEdit];
[ContactSelection setAddAddress:[addressField text]];
[ContactSelection setSipFilter:nil];
[ContactSelection setNameOrEmailFilter:nil];

View file

@ -106,9 +106,10 @@ static NSString *const kDisappearAnimation = @"disappear";
}
- (void)changeViewEvent:(NSNotification *)notif {
// UICompositeViewDescription *view = [notif.userInfo objectForKey: @"view"];
// if(view != nil)
[self updateSelectedButton:[PhoneMainView.instance firstView]];
UICompositeViewDescription *view = [notif.userInfo objectForKey:@"view"];
if (view != nil) {
[self updateSelectedButton:view];
}
}
- (void)settingsUpdate:(NSNotification *)notif {

View file

@ -0,0 +1,24 @@
/* UIAddressTextField.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import <UIKit/UIKit.h>
@interface UIAddressTextField : UITextField
@end

View file

@ -0,0 +1,38 @@
/* UIAddressTextField.h
*
* Copyright (C) 2012 Belledonne Comunications, Grenoble, France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#import "UIAddressTextField.h"
@implementation UIAddressTextField
- (void)setText:(NSString *)text {
[super setText:text];
[self sendActionsForControlEvents:UIControlEventEditingChanged];
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
// disable "define" option, since it messes with the keyboard
if ([[NSStringFromSelector(action) lowercaseString] rangeOfString:@"define"].location != NSNotFound) {
return NO;
} else {
return [super canPerformAction:action withSender:sender];
}
}
@end

View file

@ -609,6 +609,8 @@
[LinphoneUtils findAndResignFirstResponder:self.view];
CGRect d = _sideMenuView.frame;
d.origin.x = hidden ? 0 : -d.size.width;
_sideMenuView.frame = d;
d.origin.x = hidden ? -d.size.width : 0;
if (animated) {

View file

@ -681,14 +681,14 @@ static UICompositeViewDescription *compositeDescription = nil;
if ([key isEqual:@"assistant_button"]) {
[PhoneMainView.instance changeCurrentView:AssistantView.compositeViewDescription];
return;
} else if ([key isEqual:@"clear_proxy_button"]) {
} else if ([key isEqual:@"remove_proxy_button"]) {
if (linphone_core_get_default_proxy_config(lc) == NULL) {
return;
}
DTAlertView *alert = [[DTAlertView alloc]
initWithTitle:NSLocalizedString(@"Warning", nil)
message:NSLocalizedString(@"Are you sure to want to clear your proxy setup?", nil)];
message:NSLocalizedString(@"Are you sure to want to remove your proxy setup?", nil)];
[alert addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil];
[alert addButtonWithTitle:NSLocalizedString(@"Yes", nil)

View file

@ -46,7 +46,6 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info
retImage = [UIImage imageNamed:@"avatar"];
}
if (retImage.size.width != retImage.size.height) {
LOGW(@"Image is not square (%dx%d): cropping it.", retImage.size.width, retImage.size.height);
retImage = [retImage squareCrop];
}
return retImage;

View file

@ -6,9 +6,9 @@
<array>
<dict>
<key>Key</key>
<string>clear_proxy_button</string>
<string>remove_proxy_button</string>
<key>Title</key>
<string>Clear Account</string>
<string>Remove Account</string>
<key>Type</key>
<string>IASKButtonSpecifier</string>
</dict>

View file

@ -358,6 +358,7 @@
63EEE4061BBA9B010087D3AF /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; };
63EEE4071BBA9B010087D3AF /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; };
63EEE4081BBA9B010087D3AF /* libortp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2C10765B400068D98F /* libortp.a */; };
63F1DF441BCE618E00EDED90 /* UIAddressTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 63F1DF431BCE618E00EDED90 /* UIAddressTextField.m */; };
63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FB30341A680E73008CA393 /* UIRoundedImageView.m */; };
70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; };
70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F413E147EB002BA2C0 /* QuartzCore.framework */; };
@ -971,6 +972,8 @@
63EEE40B1BBA9B1B0087D3AF /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
63EEE40D1BBA9B250087D3AF /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
63EF7FDC1A24B5810017A416 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/AboutView.strings; sourceTree = "<group>"; };
63F1DF421BCE618E00EDED90 /* UIAddressTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAddressTextField.h; sourceTree = "<group>"; };
63F1DF431BCE618E00EDED90 /* UIAddressTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIAddressTextField.m; sourceTree = "<group>"; };
63FB30331A680E73008CA393 /* UIRoundedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIRoundedImageView.h; sourceTree = "<group>"; };
63FB30341A680E73008CA393 /* UIRoundedImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIRoundedImageView.m; sourceTree = "<group>"; };
7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = "<group>"; };
@ -1529,6 +1532,8 @@
340751E6150F38FD00B89C47 /* UIVideoButton.m */,
6334DDFE1BBAD5AA00631900 /* UICheckBoxTVTableViewController.h */,
6334DDFF1BBAD5AA00631900 /* UICheckBoxTVTableViewController.m */,
63F1DF421BCE618E00EDED90 /* UIAddressTextField.h */,
63F1DF431BCE618E00EDED90 /* UIAddressTextField.m */,
63C441C11BBC23ED0053DC5E /* UIAssistantTextField.h */,
63C441C21BBC23ED0053DC5E /* UIAssistantTextField.m */,
63B8D69F1BCBF43100C12B09 /* UIChatCreateCell.h */,
@ -2690,6 +2695,7 @@
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */,
D3EA53FD159850E80037DC6B /* LinphoneManager.m in Sources */,
63B81A0E1B57DA33009604A6 /* TPKeyboardAvoidingScrollView.m in Sources */,
63F1DF441BCE618E00EDED90 /* UIAddressTextField.m in Sources */,
D3EA540D1598528B0037DC6B /* ChatsListTableView.m in Sources */,
D3EA5411159853750037DC6B /* UIChatCell.m in Sources */,
D3F26BF115986B73005F9CAB /* CallIncomingView.m in Sources */,

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
version = "1.8">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
@ -37,10 +37,10 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
@ -66,11 +66,11 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
@ -94,10 +94,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">

@ -1 +1 @@
Subproject commit 217f50fa311ec103caaa20147cc6160c0d72c76b
Subproject commit 49a80e87f3237551bf60f51ef6f67aa384446af8