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.core.AccountCreator;
|
||||
import org.linphone.core.AccountCreatorListener;
|
||||
import org.linphone.core.tools.Log;
|
||||
import org.linphone.settings.LinphonePreferences;
|
||||
|
||||
public class CreateAccountActivationFragment extends Fragment
|
||||
|
@ -57,6 +58,7 @@ public class CreateAccountActivationFragment extends Fragment
|
|||
|
||||
mAccountCreator.setUsername(mUsername);
|
||||
mAccountCreator.setPassword(mPassword);
|
||||
mAccountCreator.setDomain(getString(R.string.default_domain));
|
||||
|
||||
mEmail = view.findViewById(R.id.send_email);
|
||||
mEmail.setText(getArguments().getString("Email"));
|
||||
|
@ -71,7 +73,7 @@ public class CreateAccountActivationFragment extends Fragment
|
|||
int id = v.getId();
|
||||
if (id == R.id.assistant_check) {
|
||||
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().isAccountVerified();
|
||||
} else {
|
||||
Log.w("Unexpected error " + status.name());
|
||||
Toast.makeText(
|
||||
getActivity(),
|
||||
getString(R.string.wizard_server_unavailable),
|
||||
|
|
|
@ -135,7 +135,8 @@ public class CreateAccountFragment extends Fragment
|
|||
mSkip = view.findViewById(R.id.assistant_skip);
|
||||
|
||||
// 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();
|
||||
// Automatically get the country code from the phone
|
||||
TelephonyManager tm =
|
||||
|
@ -179,12 +180,10 @@ public class CreateAccountFragment extends Fragment
|
|||
}
|
||||
addPhoneNumberHandler(mPhoneNumberEdit);
|
||||
addPhoneNumberHandler(mDialCode);
|
||||
}
|
||||
|
||||
// Password & email address
|
||||
if (getResources().getBoolean(R.bool.isTablet)
|
||||
|| !getResources().getBoolean(R.bool.use_phone_number_validation)) {
|
||||
} else {
|
||||
if (!getResources().getBoolean(R.bool.isTablet)) {
|
||||
mUseEmail.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mUseEmail.setOnCheckedChangeListener(this);
|
||||
|
||||
if (getResources().getBoolean(R.bool.pre_fill_email_in_assistant)) {
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
android:visibility="gone">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -162,7 +162,7 @@
|
|||
android:layout_column="0"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/username_label"
|
||||
|
@ -201,7 +201,7 @@
|
|||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="30dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/password_label"
|
||||
|
@ -249,7 +249,7 @@
|
|||
android:layout_column="0"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/email_label"
|
||||
|
@ -291,7 +291,7 @@
|
|||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="30dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/confirm_password_label"
|
||||
|
@ -338,12 +338,12 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="1"
|
||||
android:checked="false"
|
||||
android:checked="true"
|
||||
android:paddingLeft="5dp"
|
||||
android:button="@drawable/checkbox"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/use_username_instead_or_phone_number"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
@ -357,12 +357,12 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_column="1"
|
||||
android:checked="false"
|
||||
android:checked="true"
|
||||
android:paddingLeft="5dp"
|
||||
android:button="@drawable/checkbox"
|
||||
android:textColor="?attr/primaryTextColor"
|
||||
android:text="@string/use_email_for_validation"
|
||||
android:visibility="visible" />
|
||||
android:visibility="gone" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
|
Loading…
Reference in a new issue