Add recover password in assistant

This commit is contained in:
Margaux Clerc 2016-06-21 10:38:11 +02:00
parent a01a6a60f8
commit 516b37bc8d
3 changed files with 18 additions and 1 deletions

View file

@ -68,11 +68,18 @@
android:layout_height="40dp"
android:singleLine="true"/>
<TextView
android:id="@+id/forgot_password"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"/>
<TextView
android:text="@string/assistant_display_name_optional"
style="@style/font13"
android:textAllCaps="true"
android:paddingTop="20dp"
android:paddingTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

View file

@ -87,6 +87,7 @@
<string name="wizard_passwords_unmatched">Passwords do not match.</string>
<string name="setup_confirm_username">Your username will be %s.\r\n\r\nIt may differ from your input to match requirements.\r\nDo you accept?</string>
<string name="first_launch_no_login_password">Please enter your login and password</string>
<string name="forgot_password">Forgot password ?</string>
<!-- Dailer -->
<string name="address_bar_hint">Enter a number or an address</string>

View file

@ -22,13 +22,16 @@ import org.linphone.R;
import android.app.Fragment;
import android.os.Bundle;
import android.text.Editable;
import android.text.Html;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
/**
* @author Sylvain Berfini
@ -36,16 +39,22 @@ import android.widget.Toast;
public class LinphoneLoginFragment extends Fragment implements OnClickListener, TextWatcher {
private EditText login, password, displayName;
private Button apply;
private TextView forgotPassword;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.assistant_linphone_login, container, false);
String url = "http://linphone.org/free-sip-service.html&action=recover";
login = (EditText) view.findViewById(R.id.assistant_username);
login.addTextChangedListener(this);
password = (EditText) view.findViewById(R.id.assistant_password);
password.addTextChangedListener(this);
forgotPassword = (TextView) view.findViewById(R.id.forgot_password);
forgotPassword.setText(Html.fromHtml("<a href=\"" + url + "\"'>"+ getString(R.string.forgot_password) + "</a>"));
forgotPassword.setMovementMethod(LinkMovementMethod.getInstance());
displayName = (EditText) view.findViewById(R.id.assistant_display_name);
apply = (Button) view.findViewById(R.id.assistant_apply);
apply.setEnabled(false);