diff --git a/res/layout/assistant_account_creation.xml b/res/layout/assistant_account_creation.xml
index fa2d37c04..6655308d3 100644
--- a/res/layout/assistant_account_creation.xml
+++ b/res/layout/assistant_account_creation.xml
@@ -22,7 +22,7 @@
android:text="@string/assistant_create_account_part_1"
style="@style/font11"
android:paddingTop="10dp"
- android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
@@ -300,7 +300,7 @@
+
+
\ No newline at end of file
diff --git a/res/layout/assistant_account_creation_code_activation.xml b/res/layout/assistant_account_creation_code_activation.xml
index 47a8a13f1..4c5900b60 100644
--- a/res/layout/assistant_account_creation_code_activation.xml
+++ b/res/layout/assistant_account_creation_code_activation.xml
@@ -24,15 +24,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
-
-
diff --git a/res/raw/linphonerc_factory b/res/raw/linphonerc_factory
index 28f765950..324c8a5cb 100644
--- a/res/raw/linphonerc_factory
+++ b/res/raw/linphonerc_factory
@@ -49,4 +49,4 @@ username_length=-1
username_max_length=64
username_min_length=1
username_regex=^[a-z0-9_.\-]*$
-xmlrpc_url=https://sip3.linphone.org:444/inapp.php
+xmlrpc_url=https://sip3.linphone.org:444/wizard.php
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1f6cd6dd7..ba91d141f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -65,8 +65,7 @@
Activate accountFinish configurationYour account is created. Please check your mails to validate your account. Once it is done, come back here and click on the button.
- Enter your activation code
- This assistant will help you to use a SIP account for your calls.
+ This assistant will help you configure and use your SIP account.Enter your username and password of Linphone accountEnter your username and password with your SIP domainPlease provide your provisioning URL
@@ -74,10 +73,10 @@
Use Linphone accountUse SIP accountFetch remote configuration
- 1/2
- 2/2
+ Please confirm your country code and enter your phone number
+ We have sent you a SMS with a validation code.\n\nTo complete your phone number verification, please enter the %i digit code below:\nDisplay name (optional)
- Configure Linphone account
+ Use your Linphone accountConfigure SIP accountFetch remote configurationFetch and apply
@@ -106,11 +105,12 @@
Choose a countrySelect your Country(%s)
- Don\'t use phone number as username
+ Use a username (optional)Use email address for account validation
- Log in with username
- What is my phone number for?
- A SMS code will be sent to your phone number to validate your account.
+ Use your username and password instead of your phone number
+ What will my phone number be used for?
+ \nThanks to your phone number, your friends will find you more easily.\n\nYou will see in your addressbook who is using Linphone and your friends will know that they can rach you on Linphone as well.\n
+ \nYour friends will find your more easily if you link your account to your phone number\n\nYou will see in your addressbook who is using Linphone and your friends will know that they can rach you on Linphone as well.\nInvalid email
diff --git a/src/org/linphone/assistant/CreateAccountFragment.java b/src/org/linphone/assistant/CreateAccountFragment.java
index a2dabaf75..49d3a1bab 100644
--- a/src/org/linphone/assistant/CreateAccountFragment.java
+++ b/src/org/linphone/assistant/CreateAccountFragment.java
@@ -28,6 +28,7 @@ import org.linphone.R;
import org.linphone.core.LinphoneAccountCreator;
import org.linphone.core.LinphoneAccountCreatorImpl;
import org.linphone.core.LinphoneProxyConfig;
+import org.linphone.mediastream.Log;
import android.accounts.Account;
import android.accounts.AccountManager;
@@ -58,7 +59,7 @@ import static org.linphone.core.LinphoneAccountCreator.*;
*/
public class CreateAccountFragment extends Fragment implements CompoundButton.OnCheckedChangeListener, OnClickListener, LinphoneAccountCreatorListener {
private EditText phoneNumberEdit, usernameEdit, passwordEdit, passwordConfirmEdit, emailEdit, dialCode;
- private TextView phoneNumberError, usernameError, passwordError, passwordConfirmError, emailError, assisstantTitle, sipUri;
+ private TextView phoneNumberError, usernameError, passwordError, passwordConfirmError, emailError, assisstantTitle, sipUri, skip;
private ImageView phoneNumberInfo;
private boolean phoneNumberOk = false;
@@ -117,6 +118,8 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
emailError = (TextView) view.findViewById(R.id.email_error);
emailEdit = (EditText) view.findViewById(R.id.email);
+ skip = (TextView) view.findViewById(R.id.assistant_skip);
+
//Phone number
if(getResources().getBoolean(R.bool.use_phone_number_validation)){
//Automatically get the country code from the phone
@@ -141,6 +144,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
//Allow user to enter a username instead use the phone number as username
if(getResources().getBoolean(R.bool.assistant_allow_username) ) {
useUsername.setVisibility(View.VISIBLE);
+ useUsername.setEnabled(false);
useUsername.setOnCheckedChangeListener(this);
}
}
@@ -191,6 +195,9 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
passwordConfirmLayout.setVisibility(View.GONE);
emailLayout.setVisibility(View.GONE);
+ skip.setVisibility(View.VISIBLE);
+ skip.setOnClickListener(this);
+
createAccount.setText(getResources().getString(R.string.link_account));
assisstantTitle.setText(getResources().getString(R.string.link_account));
}
@@ -251,6 +258,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
}
} else {
usernameLayout.setVisibility(View.GONE);
+ accountCreator.setUsername(null);
}
} else if(buttonView.getId() == R.id.use_email){
if(isChecked) {
@@ -280,11 +288,23 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
break;
}
+ case R.id.assistant_skip: {
+ AssistantActivity.instance().success();
+ break;
+ }
+
case R.id.info_phone_number: {
- new AlertDialog.Builder(getActivity())
- .setTitle(getString(R.string.phone_number_info_title))
- .setMessage(getString(R.string.phone_number_info_content))
- .show();
+ if(linkAccount){
+ new AlertDialog.Builder(getActivity())
+ .setTitle(getString(R.string.phone_number_info_title))
+ .setMessage(getString(R.string.phone_number_link_info_content))
+ .show();
+ } else {
+ new AlertDialog.Builder(getActivity())
+ .setTitle(getString(R.string.phone_number_info_title))
+ .setMessage(getString(R.string.phone_number_info_content))
+ .show();
+ }
break;
}
@@ -326,7 +346,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
if(countryCode != null && countryCode.startsWith("+")) {
countryCode = countryCode.substring(1);
}
- Status status = accountCreator.setPhoneNumber(phoneNumberEdit.getText().toString(), countryCode);
+ Status status = accountCreator.setPhoneNumber(phoneNumberEdit.getText().toString(), getCountryCode());
if(status.equals(Status.Ok)){
accountCreator.linkPhoneNumberWithAccount();
}
@@ -349,17 +369,18 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
if (s.length() > 0) {
phoneNumberOk = false;
Status status = accountCreator.setPhoneNumber(phoneNumberEdit.getText().toString(), getCountryCode());
-
if(status.equals(Status.Ok)){
- accountCreator.isAccountUsed();
if(useUsername.isChecked()){
- accountCreator.setUsername(field.getText().toString());
+ accountCreator.setUsername(usernameEdit.getText().toString());
}
+ accountCreator.isAccountUsed();
} else {
+ useUsername.setEnabled(phoneNumberOk);
displayError(phoneNumberOk, phoneNumberError, phoneNumberEdit, errorForStatus(status));
sipUri.setText("");
}
} else {
+ useUsername.setEnabled(phoneNumberOk);
displayError(phoneNumberOk, phoneNumberError, phoneNumberEdit, "");
}
}
@@ -551,7 +572,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
displayError(usernameOk, usernameError, usernameEdit, errorForStatus(status));
sipUri.setText("Sip uri is sip:" + accountCreator.getUsername() + "@" + getResources().getString(R.string.default_domain));
}
- createAccount.setEnabled(usernameOk);
+ createAccount.setEnabled(usernameOk && phoneNumberOk);
} else {
if (status.equals(Status.AccountExist) || status.equals(Status.AccountExistWithAlias)) {
phoneNumberOk = false;
@@ -563,6 +584,7 @@ public class CreateAccountFragment extends Fragment implements CompoundButton.On
sipUri.setText("Sip uri is sip:" + accountCreator.getPhoneNumber() + "@" + getResources().getString(R.string.default_domain));
}
createAccount.setEnabled(phoneNumberOk);
+ useUsername.setEnabled(phoneNumberOk);
}
}