Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #1125: Added confirmation dialog for changing the password #1169

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -4,6 +4,7 @@
* Created by saksham on 13/July/2018
*/

import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
@@ -23,6 +24,7 @@
import org.mifos.mobile.ui.activities.base.BaseActivity;
import org.mifos.mobile.ui.fragments.base.BaseFragment;
import org.mifos.mobile.ui.views.UpdatePasswordView;
import org.mifos.mobile.utils.MaterialDialog;
import org.mifos.mobile.utils.Network;
import org.mifos.mobile.utils.Toaster;

@@ -82,7 +84,24 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@OnClick(R.id.btn_update_password)
void updatePassword() {
if (isFieldsCompleted()) {
presenter.updateAccountPassword(getUpdatePasswordPayload());
new MaterialDialog.Builder().init(getContext())
.setMessage(R.string.chg_pass_title)
.setPositiveButton(getString(R.string.yes),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
presenter.updateAccountPassword(getUpdatePasswordPayload());
}
})
.setNegativeButton(getString(R.string.cancel),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
})
.createMaterialDialog()
.show();
}
}

@@ -542,6 +542,7 @@
<string name="enter_tenant">Enter the Tenant</string>
<string name="account_type_loan" translatable="false">accountType.loan</string>
<string name="refresh">Refresh</string>
<string name="chg_pass_title">Are you sure you want to change your password?</string>
<string-array name="languages" translatable="false">
<item>English</item>
<item>हिंदी</item>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.