|
8 | 8 | import android.app.ProgressDialog; |
9 | 9 | import android.content.Intent; |
10 | 10 | import android.content.SharedPreferences; |
| 11 | +import android.net.Uri; |
11 | 12 | import android.os.Bundle; |
12 | 13 | import android.support.annotation.ColorRes; |
13 | 14 | import android.support.annotation.NonNull; |
|
27 | 28 | import android.widget.Button; |
28 | 29 | import android.widget.EditText; |
29 | 30 | import android.widget.TextView; |
| 31 | +import android.widget.Toast; |
30 | 32 |
|
31 | 33 | import java.io.IOException; |
32 | 34 |
|
|
44 | 46 | import fr.free.nrw.commons.di.ApplicationlessInjection; |
45 | 47 | import fr.free.nrw.commons.mwapi.MediaWikiApi; |
46 | 48 | import fr.free.nrw.commons.theme.NavigationBaseActivity; |
| 49 | +import fr.free.nrw.commons.ui.widget.HtmlTextView; |
47 | 50 | import io.reactivex.Observable; |
48 | 51 | import io.reactivex.android.schedulers.AndroidSchedulers; |
49 | 52 | import io.reactivex.schedulers.Schedulers; |
@@ -73,7 +76,9 @@ public class LoginActivity extends AccountAuthenticatorActivity { |
73 | 76 | @BindView(R.id.error_message_container) ViewGroup errorMessageContainer; |
74 | 77 | @BindView(R.id.error_message) TextView errorMessage; |
75 | 78 | @BindView(R.id.login_credentials) TextView loginCredentials; |
76 | | - @BindView(R.id.two_factor_container)TextInputLayout twoFactorContainer; |
| 79 | + @BindView(R.id.two_factor_container) TextInputLayout twoFactorContainer; |
| 80 | + @BindView(R.id.forgotPassword) HtmlTextView forgotPasswordText; |
| 81 | + |
77 | 82 | ProgressDialog progressDialog; |
78 | 83 | private AppCompatDelegate delegate; |
79 | 84 | private LoginTextWatcher textWatcher = new LoginTextWatcher(); |
@@ -114,13 +119,19 @@ public void onCreate(Bundle savedInstanceState) { |
114 | 119 | loginButton.setOnClickListener(view -> performLogin()); |
115 | 120 | signupButton.setOnClickListener(view -> signUp()); |
116 | 121 |
|
| 122 | + forgotPasswordText.setOnClickListener(view -> forgotPassword()); |
| 123 | + |
117 | 124 | if(BuildConfig.FLAVOR == "beta"){ |
118 | 125 | loginCredentials.setText(getString(R.string.login_credential)); |
119 | 126 | } else { |
120 | 127 | loginCredentials.setVisibility(View.GONE); |
121 | 128 | } |
122 | 129 | } |
123 | 130 |
|
| 131 | + private void forgotPassword() { |
| 132 | + Utils.handleWebUrl(this, Uri.parse(BuildConfig.FORGOT_PASSWORD_URL)); |
| 133 | + } |
| 134 | + |
124 | 135 |
|
125 | 136 | public void hideKeyboard(View view) { |
126 | 137 | InputMethodManager inputMethodManager =(InputMethodManager)this.getSystemService(Activity.INPUT_METHOD_SERVICE); |
|
0 commit comments