mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 09:39:25 +03:00
Merge pull request #1053 from owncloud/pincode_request_is_not_starting_when_rotating
Fixed: pass code request not restarted anymore when the device is rotated
This commit is contained in:
commit
2c3d44f47e
1 changed files with 25 additions and 7 deletions
|
@ -61,7 +61,9 @@ public class PassCodeActivity extends ActionBarActivity {
|
|||
private EditText[] mPassCodeEditTexts = new EditText[4];
|
||||
|
||||
private String [] mPassCodeDigits = {"","","",""};
|
||||
private static String KEY_PASSCODE_DIGITS = "PASSCODE_DIGITS";
|
||||
private boolean mConfirmingPassCode = false;
|
||||
private static String KEY_CONFIRMING_PASSCODE = "CONFIRMING_PASSCODE";
|
||||
|
||||
private boolean mBChange = true; // to control that only one blocks jump
|
||||
|
||||
|
@ -96,13 +98,22 @@ public class PassCodeActivity extends ActionBarActivity {
|
|||
setCancelButtonEnabled(false); // no option to cancel
|
||||
|
||||
} else if (ACTION_ENABLE.equals(getIntent().getAction())) {
|
||||
/// pass code preference has just been activated in Preferences;
|
||||
// will receive and confirm pass code value
|
||||
mPassCodeHdr.setText(R.string.pass_code_configure_your_pass_code);
|
||||
//mPassCodeHdr.setText(R.string.pass_code_enter_pass_code);
|
||||
// TODO choose a header, check iOS
|
||||
mPassCodeHdrExplanation.setVisibility(View.VISIBLE);
|
||||
setCancelButtonEnabled(true);
|
||||
if (savedInstanceState != null) {
|
||||
mConfirmingPassCode = savedInstanceState.getBoolean(PassCodeActivity.KEY_CONFIRMING_PASSCODE);
|
||||
mPassCodeDigits = savedInstanceState.getStringArray(PassCodeActivity.KEY_PASSCODE_DIGITS);
|
||||
}
|
||||
if(mConfirmingPassCode){
|
||||
//the app was in the passcodeconfirmation
|
||||
requestPassCodeConfirmation();
|
||||
}else{
|
||||
/// pass code preference has just been activated in Preferences;
|
||||
// will receive and confirm pass code value
|
||||
mPassCodeHdr.setText(R.string.pass_code_configure_your_pass_code);
|
||||
//mPassCodeHdr.setText(R.string.pass_code_enter_pass_code);
|
||||
// TODO choose a header, check iOS
|
||||
mPassCodeHdrExplanation.setVisibility(View.VISIBLE);
|
||||
setCancelButtonEnabled(true);
|
||||
}
|
||||
|
||||
} else if (ACTION_DISABLE.equals(getIntent().getAction())) {
|
||||
/// pass code preference has just been disabled in Preferences;
|
||||
|
@ -455,6 +466,13 @@ public class PassCodeActivity extends ActionBarActivity {
|
|||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putBoolean(PassCodeActivity.KEY_CONFIRMING_PASSCODE, mConfirmingPassCode);
|
||||
outState.putStringArray(PassCodeActivity.KEY_PASSCODE_DIGITS, mPassCodeDigits);
|
||||
}
|
||||
|
||||
|
||||
private class PassCodeDigitTextWatcher implements TextWatcher {
|
||||
|
||||
|
|
Loading…
Reference in a new issue