forked from mirrors/linphone-iphone
Wizard: add UITextField+DoneButton useful for phonepad keyboard on iPhone
This commit is contained in:
parent
0cfcf60064
commit
36367c9083
5 changed files with 60 additions and 1 deletions
|
|
@ -476,7 +476,7 @@
|
|||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="These parameters were retrieved from a remote provisioning profile." textAlignment="center" lineBreakMode="wordWrap" numberOfLines="7" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="RHE-hi-dfB" userLabel="remoteParamsLabel">
|
||||
<rect key="frame" x="34" y="414" width="254" height="82"/>
|
||||
<rect key="frame" x="34" y="414.00000272146076" width="254" height="82"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="11"/>
|
||||
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
|
||||
|
|
|
|||
13
Classes/LinphoneUI/UITextField+DoneButton.h
Normal file
13
Classes/LinphoneUI/UITextField+DoneButton.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
//
|
||||
// UITextField+DoneButton.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 14/10/14.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface UITextField (DoneButton)
|
||||
- (void)addDoneButton;
|
||||
@end
|
||||
38
Classes/LinphoneUI/UITextField+DoneButton.m
Normal file
38
Classes/LinphoneUI/UITextField+DoneButton.m
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// UITextField+DoneButton.m
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 14/10/14.
|
||||
//
|
||||
//
|
||||
|
||||
#import "UITextField+DoneButton.h"
|
||||
|
||||
#import "LinphoneManager.h"
|
||||
|
||||
@implementation UITextField (DoneButton)
|
||||
|
||||
- (void) addDoneButton {
|
||||
// actually on iPad there is a done button
|
||||
if (! [LinphoneManager runningOnIpad]) {
|
||||
UIToolbar* numberToolbar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];
|
||||
numberToolbar.items = [NSArray arrayWithObjects:
|
||||
[[UIBarButtonItem alloc]initWithTitle:NSLocalizedString(@"Cancel", nil) style:UIBarButtonItemStyleBordered target:self action:@selector(cancelNumberPad)],
|
||||
[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil],
|
||||
[[UIBarButtonItem alloc]initWithTitle:NSLocalizedString(@"Done", nil) style:UIBarButtonItemStyleDone target:self action:@selector(doneWithNumberPad)],
|
||||
nil];
|
||||
[numberToolbar sizeToFit];
|
||||
|
||||
self.inputAccessoryView = numberToolbar;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)cancelNumberPad{
|
||||
[self resignFirstResponder];
|
||||
self.text = @"";
|
||||
}
|
||||
|
||||
-(void)doneWithNumberPad{
|
||||
[self resignFirstResponder];
|
||||
}
|
||||
@end
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
#import "WizardViewController.h"
|
||||
#import "LinphoneManager.h"
|
||||
#import "PhoneMainView.h"
|
||||
#import "UITextField+DoneButton.h"
|
||||
|
||||
#import <XMLRPCConnection.h>
|
||||
#import <XMLRPCConnectionManager.h>
|
||||
|
|
@ -232,6 +233,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
if (usePhoneNumber) {
|
||||
text.keyboardType = UIKeyboardTypePhonePad;
|
||||
text.placeholder = NSLocalizedString(@"Phone number", nil);
|
||||
[text addDoneButton];
|
||||
} else {
|
||||
text.keyboardType = UIKeyboardTypeDefault;
|
||||
text.placeholder = NSLocalizedString(@"Username", nil);
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@
|
|||
57F005C415EE2CCF00914747 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C315EE2CCF00914747 /* linphonerc */; };
|
||||
57F005C815EE2D9200914747 /* linphonerc-factory in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C615EE2D9200914747 /* linphonerc-factory */; };
|
||||
57F005CA15EE2D9200914747 /* linphonerc-factory~ipad in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C715EE2D9200914747 /* linphonerc-factory~ipad */; };
|
||||
630CF5571AF7CE1500539F7A /* UITextField+DoneButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 630CF5561AF7CE1500539F7A /* UITextField+DoneButton.m */; };
|
||||
631C4FB119D2A8F2004BFE77 /* UIDigitButtonLongPlus.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */; };
|
||||
631C4FB719D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */; };
|
||||
6359DE7F1ADEB54200EA15C0 /* InAppProductsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6359DE7D1ADEB54200EA15C0 /* InAppProductsViewController.m */; };
|
||||
|
|
@ -1019,6 +1020,8 @@
|
|||
57F005C315EE2CCF00914747 /* linphonerc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = linphonerc; path = Resources/linphonerc; sourceTree = "<group>"; };
|
||||
57F005C615EE2D9200914747 /* linphonerc-factory */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory"; path = "Resources/linphonerc-factory"; sourceTree = "<group>"; };
|
||||
57F005C715EE2D9200914747 /* linphonerc-factory~ipad */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = "linphonerc-factory~ipad"; path = "Resources/linphonerc-factory~ipad"; sourceTree = "<group>"; };
|
||||
630CF5551AF7CE1500539F7A /* UITextField+DoneButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UITextField+DoneButton.h"; sourceTree = "<group>"; };
|
||||
630CF5561AF7CE1500539F7A /* UITextField+DoneButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UITextField+DoneButton.m"; sourceTree = "<group>"; };
|
||||
631C4FAF19D2A8F2004BFE77 /* UIDigitButtonLongPlus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongPlus.h; sourceTree = "<group>"; };
|
||||
631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongPlus.m; sourceTree = "<group>"; };
|
||||
631C4FB519D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongVoiceMail.h; sourceTree = "<group>"; };
|
||||
|
|
@ -2114,6 +2117,8 @@
|
|||
22C7555E1317E59C007BC101 /* UIBluetoothButton.h */,
|
||||
22C7555F1317E59C007BC101 /* UIBluetoothButton.m */,
|
||||
636316DC1A1DEECB0009B839 /* UIButtonShrinkable.h */,
|
||||
630CF5551AF7CE1500539F7A /* UITextField+DoneButton.h */,
|
||||
630CF5561AF7CE1500539F7A /* UITextField+DoneButton.m */,
|
||||
636316DD1A1DEF2F0009B839 /* UIButtonShrinkable.m */,
|
||||
D326483B1588950F00930C67 /* UICallBar.h */,
|
||||
D326483C1588950F00930C67 /* UICallBar.m */,
|
||||
|
|
@ -3974,6 +3979,7 @@
|
|||
2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */,
|
||||
2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */,
|
||||
2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */,
|
||||
630CF5571AF7CE1500539F7A /* UITextField+DoneButton.m in Sources */,
|
||||
2214EBF312F86360002A5394 /* UIMicroButton.m in Sources */,
|
||||
22968A5F12F875C600588287 /* UISpeakerButton.m in Sources */,
|
||||
2218A92512FBE1340088A667 /* FirstLoginViewController.m in Sources */,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue