Commit 9b979bdb authored by DanmeiChen's avatar DanmeiChen

make login button insensitive

parent fe8edab6
......@@ -43,6 +43,7 @@
@property(nonatomic, strong) IBOutlet UIView *waitView;
@property(nonatomic, strong) IBOutlet UIButton *backButton;
@property (weak, nonatomic) IBOutlet UIButton *infoLoginButton;
@property (weak, nonatomic) IBOutlet UIRoundBorderedButton *linphoneLoginButton;
@property(nonatomic, strong) IBOutlet UIView *welcomeView;
@property(nonatomic, strong) IBOutlet UIView *createAccountView;
......
......@@ -1050,6 +1050,10 @@ static UICompositeViewDescription *compositeDescription = nil;
}
}
// enable linphoneLoginButton if error
[_linphoneLoginButton setBackgroundColor:[UIColor clearColor]];
_linphoneLoginButton.enabled = YES;
}
- (void) isAccountActivated:(const char *)resp {
......@@ -1309,8 +1313,13 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
}
- (IBAction)onLinphoneLoginClick:(id)sender {
ONCLICKBUTTON(sender, 100, {
_waitView.hidden = NO;
// disable button after first click
_linphoneLoginButton.enabled = NO;
[_linphoneLoginButton setBackgroundColor:[UIColor lightGrayColor]];
_waitView.hidden = NO;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (100 * NSEC_PER_MSEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
((UITextField *)[self findView:ViewElement_SMSCode inView:_contentView ofType:UITextField.class]).text = @"";
_activationTitle.text = @"USE LINPHONE ACCOUNT";
if ((linphone_account_creator_get_phone_number(account_creator) != NULL) &&
......@@ -1324,7 +1333,7 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
// if not, propose it to the user
linphone_account_creator_is_account_exist(account_creator);
}
});
});
}
- (IBAction)onLoginClick:(id)sender {
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -27,6 +24,7 @@
<outlet property="gotoLoginButton" destination="39" id="uSY-cr-j4w"/>
<outlet property="gotoRemoteProvisioningButton" destination="Kbn-dL-C5h" id="zLh-uO-x8P"/>
<outlet property="infoLoginButton" destination="ZDs-1W-ZXo" id="aoP-Mb-gPi"/>
<outlet property="linphoneLoginButton" destination="eIr-bh-JLB" id="mhf-Tc-zyb"/>
<outlet property="linphoneLoginView" destination="52" id="9NX-6W-50g"/>
<outlet property="loginView" destination="56" id="bJH-N8-uPi"/>
<outlet property="phoneLabel" destination="ZSJ-Lv-n60" id="5Qi-xR-wyK"/>
......@@ -745,7 +743,7 @@ Once it is done, come back here and click on the button.</string>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="USE YOUR LINPHONE ACCOUNT" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="10" translatesAutoresizingMaskIntoConstraints="NO" id="LbS-op-QAh" userLabel="titleLabel">
<rect key="frame" x="36" y="0.0" width="303" height="40"/>
<rect key="frame" x="36" y="0.0" width="302" height="40"/>
<accessibility key="accessibilityConfiguration" label="Account setup assistant"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="iKL-h4-J6A"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment