diff --git a/Classes/AssistantView.h b/Classes/AssistantView.h index 20a9de39a..7a0866cba 100644 --- a/Classes/AssistantView.h +++ b/Classes/AssistantView.h @@ -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; diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index caba5b1e6..e9b8c968c 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -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 { diff --git a/Classes/Base.lproj/AssistantViewScreens.xib b/Classes/Base.lproj/AssistantViewScreens.xib index 119ccd336..71c36e10e 100644 --- a/Classes/Base.lproj/AssistantViewScreens.xib +++ b/Classes/Base.lproj/AssistantViewScreens.xib @@ -1,14 +1,11 @@ - + - - - - + @@ -27,6 +24,7 @@ + @@ -745,7 +743,7 @@ Once it is done, come back here and click on the button.