Workarounded account creation issue on tablets, proper fix will come with assistant rework
This commit is contained in:
parent
d14c4609b3
commit
112bbcf899
3 changed files with 19 additions and 17 deletions
|
@ -31,6 +31,7 @@ import org.linphone.LinphoneManager;
|
||||||
import org.linphone.R;
|
import org.linphone.R;
|
||||||
import org.linphone.core.AccountCreator;
|
import org.linphone.core.AccountCreator;
|
||||||
import org.linphone.core.AccountCreatorListener;
|
import org.linphone.core.AccountCreatorListener;
|
||||||
|
import org.linphone.core.tools.Log;
|
||||||
import org.linphone.settings.LinphonePreferences;
|
import org.linphone.settings.LinphonePreferences;
|
||||||
|
|
||||||
public class CreateAccountActivationFragment extends Fragment
|
public class CreateAccountActivationFragment extends Fragment
|
||||||
|
@ -57,6 +58,7 @@ public class CreateAccountActivationFragment extends Fragment
|
||||||
|
|
||||||
mAccountCreator.setUsername(mUsername);
|
mAccountCreator.setUsername(mUsername);
|
||||||
mAccountCreator.setPassword(mPassword);
|
mAccountCreator.setPassword(mPassword);
|
||||||
|
mAccountCreator.setDomain(getString(R.string.default_domain));
|
||||||
|
|
||||||
mEmail = view.findViewById(R.id.send_email);
|
mEmail = view.findViewById(R.id.send_email);
|
||||||
mEmail.setText(getArguments().getString("Email"));
|
mEmail.setText(getArguments().getString("Email"));
|
||||||
|
@ -71,7 +73,7 @@ public class CreateAccountActivationFragment extends Fragment
|
||||||
int id = v.getId();
|
int id = v.getId();
|
||||||
if (id == R.id.assistant_check) {
|
if (id == R.id.assistant_check) {
|
||||||
mCheckAccount.setEnabled(false);
|
mCheckAccount.setEnabled(false);
|
||||||
mAccountCreator.isAccountActivated();
|
AccountCreator.Status status = mAccountCreator.isAccountActivated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +113,7 @@ public class CreateAccountActivationFragment extends Fragment
|
||||||
AssistantActivity.instance().linphoneLogIn(accountCreator);
|
AssistantActivity.instance().linphoneLogIn(accountCreator);
|
||||||
AssistantActivity.instance().isAccountVerified();
|
AssistantActivity.instance().isAccountVerified();
|
||||||
} else {
|
} else {
|
||||||
|
Log.w("Unexpected error " + status.name());
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
getActivity(),
|
getActivity(),
|
||||||
getString(R.string.wizard_server_unavailable),
|
getString(R.string.wizard_server_unavailable),
|
||||||
|
|
|
@ -135,7 +135,8 @@ public class CreateAccountFragment extends Fragment
|
||||||
mSkip = view.findViewById(R.id.assistant_skip);
|
mSkip = view.findViewById(R.id.assistant_skip);
|
||||||
|
|
||||||
// Phone number
|
// Phone number
|
||||||
if (getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
if (!getResources().getBoolean(R.bool.isTablet)
|
||||||
|
&& getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
||||||
getActivity().getApplicationContext();
|
getActivity().getApplicationContext();
|
||||||
// Automatically get the country code from the phone
|
// Automatically get the country code from the phone
|
||||||
TelephonyManager tm =
|
TelephonyManager tm =
|
||||||
|
@ -179,12 +180,10 @@ public class CreateAccountFragment extends Fragment
|
||||||
}
|
}
|
||||||
addPhoneNumberHandler(mPhoneNumberEdit);
|
addPhoneNumberHandler(mPhoneNumberEdit);
|
||||||
addPhoneNumberHandler(mDialCode);
|
addPhoneNumberHandler(mDialCode);
|
||||||
}
|
} else {
|
||||||
|
if (!getResources().getBoolean(R.bool.isTablet)) {
|
||||||
// Password & email address
|
mUseEmail.setVisibility(View.VISIBLE);
|
||||||
if (getResources().getBoolean(R.bool.isTablet)
|
}
|
||||||
|| !getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
|
||||||
mUseEmail.setVisibility(View.VISIBLE);
|
|
||||||
mUseEmail.setOnCheckedChangeListener(this);
|
mUseEmail.setOnCheckedChangeListener(this);
|
||||||
|
|
||||||
if (getResources().getBoolean(R.bool.pre_fill_email_in_assistant)) {
|
if (getResources().getBoolean(R.bool.pre_fill_email_in_assistant)) {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="visible">
|
android:visibility="gone">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/username_label"
|
android:id="@+id/username_label"
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="30dp"
|
android:paddingLeft="30dp"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/password_label"
|
android:id="@+id/password_label"
|
||||||
|
@ -249,7 +249,7 @@
|
||||||
android:layout_column="0"
|
android:layout_column="0"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/email_label"
|
android:id="@+id/email_label"
|
||||||
|
@ -291,7 +291,7 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="30dp"
|
android:paddingLeft="30dp"
|
||||||
android:visibility="gone">
|
android:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/confirm_password_label"
|
android:id="@+id/confirm_password_label"
|
||||||
|
@ -338,12 +338,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:checked="false"
|
android:checked="true"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:button="@drawable/checkbox"
|
android:button="@drawable/checkbox"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:text="@string/use_username_instead_or_phone_number"
|
android:text="@string/use_username_instead_or_phone_number"
|
||||||
android:visibility="visible" />
|
android:visibility="gone" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
|
@ -357,12 +357,12 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_column="1"
|
android:layout_column="1"
|
||||||
android:checked="false"
|
android:checked="true"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:button="@drawable/checkbox"
|
android:button="@drawable/checkbox"
|
||||||
android:textColor="?attr/primaryTextColor"
|
android:textColor="?attr/primaryTextColor"
|
||||||
android:text="@string/use_email_for_validation"
|
android:text="@string/use_email_for_validation"
|
||||||
android:visibility="visible" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue