Generic sip account assistant working
This commit is contained in:
parent
460f878b69
commit
301309184f
5 changed files with 116 additions and 4 deletions
|
@ -4,5 +4,89 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<ImageView
|
||||
android:paddingTop="40dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/setup_title_assistant"/>
|
||||
|
||||
<TextView
|
||||
android:paddingTop="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/setup_linphone_account_hint"
|
||||
android:textColor="@android:color/black"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/setup_username"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setup_username_hint"
|
||||
android:inputType="textEmailAddress"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/setup_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setup_password_hint"
|
||||
android:inputType="textPassword"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/setup_domain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/setup_domain_hint"
|
||||
android:inputType="textEmailAddress"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<RelativeLayout
|
||||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/setup_apply"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/button"
|
||||
android:layout_centerInParent="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/setup_apply"
|
||||
android:textColor="@android:color/black"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -295,7 +295,7 @@
|
|||
<string name="content_description_next"></string>
|
||||
<string name="content_description_back"></string>
|
||||
|
||||
<string name="wizard_title">Account Setup Assistant</string>
|
||||
<string name="setup_title">Account Setup Assistant</string>
|
||||
<string name="setup_welcome">This assistant will help you to use a SIP account for your calls.</string>
|
||||
<string name="setup_create_account">Create an account on linphone.org</string>
|
||||
<string name="setup_login_linphone">I already have a linphone.org account</string>
|
||||
|
@ -304,6 +304,7 @@
|
|||
<string name="setup_apply">Apply</string>
|
||||
<string name="setup_username_hint">username</string>
|
||||
<string name="setup_password_hint">password</string>
|
||||
<string name="setup_domain_hint">domain</string>
|
||||
<string name="setup_password_confirm_hint">confirm password</string>
|
||||
<string name="setup_email_hint">email</string>
|
||||
<string name="setup_create">Create Account</string>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
android:title="@string/pref_enable_outbound_proxy"></CheckBoxPreference>-->
|
||||
</PreferenceCategory>
|
||||
|
||||
<Preference android:title="@string/wizard_title"></Preference>
|
||||
<Preference android:title="@string/setup_title"></Preference>
|
||||
|
||||
<PreferenceCategory android:key="@string/pref_tunnel_key" android:title="@string/pref_tunnel">
|
||||
<EditTextPreference android:title="@string/pref_tunnel_host"
|
||||
|
|
|
@ -24,15 +24,42 @@ import android.support.v4.app.Fragment;
|
|||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
/**
|
||||
* @author Sylvain Berfini
|
||||
*/
|
||||
public class GenericLoginFragment extends Fragment {
|
||||
public class GenericLoginFragment extends Fragment implements OnClickListener {
|
||||
private EditText login, password, domain;
|
||||
private ImageView apply;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.setup_generic_login, container, false);
|
||||
|
||||
login = (EditText) view.findViewById(R.id.setup_username);
|
||||
password = (EditText) view.findViewById(R.id.setup_password);
|
||||
domain = (EditText) view.findViewById(R.id.setup_domain);
|
||||
apply = (ImageView) view.findViewById(R.id.setup_apply);
|
||||
apply.setOnClickListener(this);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
||||
if (id == R.id.setup_apply) {
|
||||
if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0 || domain.getText() == null || domain.length() == 0) {
|
||||
Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
SetupActivity.instance().logIn(login.getText().toString(), password.getText().toString(), domain.getText().toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
|
|||
|
||||
if (id == R.id.setup_apply) {
|
||||
if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0) {
|
||||
Toast.makeText(getActivity().getApplicationContext(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue