When the pattern is set in settings, show message to the user

This commit is contained in:
dtvv 2018-10-18 08:08:16 -05:00
parent 03e03f2fb1
commit 0019385827
2 changed files with 29 additions and 1 deletions

View file

@ -139,7 +139,6 @@ public class PatternSecurityFragment extends Fragment {
public void onComplete(List<PatternLockView.Dot> pattern) { public void onComplete(List<PatternLockView.Dot> pattern) {
if (patternEntered.equals(patternToString(pattern))){ if (patternEntered.equals(patternToString(pattern))){
savePattern(patternEntered); savePattern(patternEntered);
showNewPatternUI();
} }
else{ else{
resetPattern(); resetPattern();
@ -188,5 +187,32 @@ public class PatternSecurityFragment extends Fragment {
String patternEncripted = PasswordManager.encriptPassword(pattern); String patternEncripted = PasswordManager.encriptPassword(pattern);
CrystalSecurityMonitor.getInstance(null).setPatternEncrypted(patternEncripted); CrystalSecurityMonitor.getInstance(null).setPatternEncrypted(patternEncripted);
//CrystalSecurityMonitor.getInstance(null).callPasswordRequest(this.getActivity()); //CrystalSecurityMonitor.getInstance(null).callPasswordRequest(this.getActivity());
/*
* Show success
* */
tvPatternText.setText(getActivity().getResources().getString(R.string.Pattern_set_correctly));
tvPatternText.setTextColor(Color.GREEN);
final Timer t = new Timer();
t.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
t.cancel();
showNewPatternUI();
}
});
}
},
//Set how long before to start calling the TimerTask (in milliseconds)
1000,
//Set the amount of time between each execution (in milliseconds)
1000);
} }
} }

View file

@ -78,6 +78,8 @@
<string name="Enter_new_pattern">Enter new pattern</string> <string name="Enter_new_pattern">Enter new pattern</string>
<string name="Incorrect_pattern">Incorrect pattern</string> <string name="Incorrect_pattern">Incorrect pattern</string>
<string name="Pattern_set_correctly">Pattern set correctly</string>
<string name="Confirm_new_pattern">Confirm new pattern</string> <string name="Confirm_new_pattern">Confirm new pattern</string>
<string name="error_invalid_account">Invalid account, please check your brain key for typing errors</string> <string name="error_invalid_account">Invalid account, please check your brain key for typing errors</string>