Skip to content

Commit

Permalink
Fix: Add Material Dialog for login using password confirmation (#1238)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchtgpt authored and luckyman20 committed Dec 25, 2019
1 parent b1c4bec commit 75f7c66
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.mifos.mobile.ui.activities;

import android.Manifest;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
Expand All @@ -11,6 +12,7 @@
import org.mifos.mobile.R;
import org.mifos.mobile.utils.CheckSelfPermissionAndRequest;
import org.mifos.mobile.utils.Constants;
import org.mifos.mobile.utils.MaterialDialog;
import org.mifos.mobile.utils.Toaster;

public class PassCodeActivity extends MifosPassCodeActivity {
Expand Down Expand Up @@ -51,10 +53,30 @@ public void startNextActivity() {

@Override
public void startLoginActivity() {
Intent i = new Intent(PassCodeActivity.this, LoginActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
finish();
new MaterialDialog.Builder().init(PassCodeActivity.this)
.setCancelable(false)
.setMessage(R.string.login_using_password_confirmation)
.setPositiveButton(getString(R.string.logout),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent i = new Intent(PassCodeActivity.this,
LoginActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.
FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
finish();
}
})
.setNegativeButton(getString(R.string.cancel),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
})
.createMaterialDialog()
.show();
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@
<string name="delete_beneficiary_confirmation">Are you sure you want to delete this
Beneficiary
</string>
<string name="login_using_password_confirmation">Are you sure you want to login using Password?
</string>
<string name="delete">Delete</string>
<string name="beneficiary_deleted_successfully">Beneficiary deleted successfully</string>
<string name="third_party_transfer">Third Party Transfer</string>
Expand Down

0 comments on commit 75f7c66

Please sign in to comment.