From 00193858273f7fb7bfe07b82ef971f47ba58f6d4 Mon Sep 17 00:00:00 2001 From: dtvv Date: Thu, 18 Oct 2018 08:08:16 -0500 Subject: [PATCH] When the pattern is set in settings, show message to the user --- .../fragments/PatternSecurityFragment.java | 28 ++++++++++++++++++- app/src/main/res/values/strings.xml | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/PatternSecurityFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/PatternSecurityFragment.java index 3522a6e..070b1b8 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/PatternSecurityFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/PatternSecurityFragment.java @@ -139,7 +139,6 @@ public class PatternSecurityFragment extends Fragment { public void onComplete(List pattern) { if (patternEntered.equals(patternToString(pattern))){ savePattern(patternEntered); - showNewPatternUI(); } else{ resetPattern(); @@ -188,5 +187,32 @@ public class PatternSecurityFragment extends Fragment { String patternEncripted = PasswordManager.encriptPassword(pattern); CrystalSecurityMonitor.getInstance(null).setPatternEncrypted(patternEncripted); //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); } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4a54641..719f5cd 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -78,6 +78,8 @@ Enter new pattern Incorrect pattern + Pattern set correctly + Confirm new pattern Invalid account, please check your brain key for typing errors