Add new strings and fix issues
This commit is contained in:
parent
919d36c3f4
commit
f5a9be9432
6 changed files with 58 additions and 32 deletions
|
@ -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 @@
|
|||
|
||||
<Button
|
||||
android:id="@+id/assistant_create"
|
||||
android:text="@string/assistant_continue"
|
||||
android:text="@string/assistant_create_account"
|
||||
android:background="@drawable/assistant_button"
|
||||
android:textColor="@drawable/assistant_button_text_color"
|
||||
style="@style/font8"
|
||||
|
@ -310,6 +310,18 @@
|
|||
android:paddingRight="10dp"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/assistant_skip"
|
||||
android:visibility="gone"
|
||||
android:text="@string/maybe_later"
|
||||
android:textColor="@drawable/assistant_button_text_color"
|
||||
style="@style/font10"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:layout_marginTop="20dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -24,15 +24,6 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/assistant_validate_code"
|
||||
style="@style/font11"
|
||||
android:paddingTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_code"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_gravity="center"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/assistant_linphone_login_desc"
|
||||
android:text="@string/assistant_create_account_part_1"
|
||||
style="@style/font11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -98,6 +98,7 @@
|
|||
<CheckBox
|
||||
android:id="@+id/use_username"
|
||||
android:visibility="visible"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/login_with_username"/>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -65,8 +65,7 @@
|
|||
<string name="assistant_activate">Activate account</string>
|
||||
<string name="assistant_finish">Finish configuration</string>
|
||||
<string name="assistant_validate_account">Your account is created. Please check your mails to validate your account. Once it is done, come back here and click on the button.</string>
|
||||
<string name="assistant_validate_code">Enter your activation code</string>
|
||||
<string name="assistant_welcome_desc">This assistant will help you to use a SIP account for your calls.</string>
|
||||
<string name="assistant_welcome_desc">This assistant will help you configure and use your SIP account.</string>
|
||||
<string name="assistant_linphone_login_desc">Enter your username and password of Linphone account</string>
|
||||
<string name="assistant_login_desc">Enter your username and password with your SIP domain</string>
|
||||
<string name="assistant_remote_provisioning_desc">Please provide your provisioning URL</string>
|
||||
|
@ -74,10 +73,10 @@
|
|||
<string name="assistant_login_linphone">Use Linphone account</string>
|
||||
<string name="assistant_login_generic">Use SIP account</string>
|
||||
<string name="assistant_remote_provisioning">Fetch remote configuration</string>
|
||||
<string name="assistant_create_account_part_1">1/2</string>
|
||||
<string name="assistant_create_account_part_2">2/2</string>
|
||||
<string name="assistant_create_account_part_1">Please confirm your country code and enter your phone number</string>
|
||||
<string name="assistant_create_account_part_2">We have sent you a SMS with a validation code.\n\nTo complete your phone number verification, please enter the %i digit code below:\n</string>
|
||||
<string name="assistant_display_name_optional">Display name (optional)</string>
|
||||
<string name="assistant_linphone_account">Configure Linphone account</string>
|
||||
<string name="assistant_linphone_account">Use your Linphone account</string>
|
||||
<string name="assistant_generic_account">Configure SIP account</string>
|
||||
<string name="assistant_remote_provisioning_title">Fetch remote configuration</string>
|
||||
<string name="assistant_fetch_apply">Fetch and apply</string>
|
||||
|
@ -106,11 +105,12 @@
|
|||
<string name="assistant_choose_country">Choose a country</string>
|
||||
<string name="select_your_country">Select your Country</string>
|
||||
<string name="country_code">(%s)</string>
|
||||
<string name="use_username_instead_or_phone_number">Don\'t use phone number as username</string>
|
||||
<string name="use_username_instead_or_phone_number">Use a username (optional)</string>
|
||||
<string name="use_email_for_validation">Use email address for account validation</string>
|
||||
<string name="login_with_username">Log in with username</string>
|
||||
<string name="phone_number_info_title">What is my phone number for?</string>
|
||||
<string name="phone_number_info_content">A SMS code will be sent to your phone number to validate your account.</string>
|
||||
<string name="login_with_username">Use your username and password instead of your phone number</string>
|
||||
<string name="phone_number_info_title">What will my phone number be used for?</string>
|
||||
<string name="phone_number_info_content">\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</string>
|
||||
<string name="phone_number_link_info_content">\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.\n</string>
|
||||
|
||||
<!-- Status -->
|
||||
<string name="invalid_email">Invalid email</string>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue