Skip to content

Commit

Permalink
dialogBox for forgot pin
Browse files Browse the repository at this point in the history
  • Loading branch information
rchtgpt committed Dec 5, 2019
1 parent dff5706 commit 6a1de1a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package org.mifos.mobile.ui.activities;

import android.Manifest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.mifos.mobile.passcode.MifosPassCodeActivity;
import com.mifos.mobile.passcode.utils.EncryptionUtil;
Expand Down Expand Up @@ -51,10 +54,24 @@ 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();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.login_using_password_confirmation);
builder.setCancelable(false);
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent i = new Intent(PassCodeActivity.this, LoginActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
finish();
}
})
.setNegativeButton("No", null);
AlertDialog alert = builder.create();
alert.show();
Button nbutton = alert.getButton(DialogInterface.BUTTON_NEGATIVE);
nbutton.setTextColor(getApplication().getResources().getColor(R.color.primary_dark));
Button pbutton = alert.getButton(DialogInterface.BUTTON_POSITIVE);
pbutton.setTextColor(getApplication().getResources().getColor(R.color.primary_dark));
}

@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 6a1de1a

Please sign in to comment.