Java Code Examples for org.telegram.messenger.SharedConfig#badPasscodeTries()
The following examples show how to use
org.telegram.messenger.SharedConfig#badPasscodeTries() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PasscodeView.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
private void processDone(boolean fingerprint) { if (!fingerprint) { if (SharedConfig.passcodeRetryInMs > 0) { return; } String password = ""; if (SharedConfig.passcodeType == 0) { password = passwordEditText2.getString(); } else if (SharedConfig.passcodeType == 1) { password = passwordEditText.getText().toString(); } if (password.length() == 0) { onPasscodeError(); return; } if (!SharedConfig.checkPasscode(password)) { SharedConfig.increaseBadPasscodeTries(); if (SharedConfig.passcodeRetryInMs > 0) { checkRetryTextView(); } passwordEditText.setText(""); passwordEditText2.eraseAllCharacters(true); onPasscodeError(); return; } } SharedConfig.badPasscodeTries = 0; passwordEditText.clearFocus(); AndroidUtilities.hideKeyboard(passwordEditText); AnimatorSet AnimatorSet = new AnimatorSet(); AnimatorSet.setDuration(200); AnimatorSet.playTogether( ObjectAnimator.ofFloat(this, "translationY", AndroidUtilities.dp(20)), ObjectAnimator.ofFloat(this, "alpha", AndroidUtilities.dp(0.0f))); AnimatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setVisibility(View.GONE); } }); AnimatorSet.start(); SharedConfig.appLocked = false; SharedConfig.saveConfig(); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetPasscode); setOnTouchListener(null); if (delegate != null) { delegate.didAcceptedPassword(); } }
Example 2
Source File: PasscodeView.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
private void processDone(boolean fingerprint) { if (!fingerprint) { if (SharedConfig.passcodeRetryInMs > 0) { return; } String password = ""; if (SharedConfig.passcodeType == 0) { password = passwordEditText2.getString(); } else if (SharedConfig.passcodeType == 1) { password = passwordEditText.getText().toString(); } if (password.length() == 0) { onPasscodeError(); return; } if (!SharedConfig.checkPasscode(password)) { SharedConfig.increaseBadPasscodeTries(); if (SharedConfig.passcodeRetryInMs > 0) { checkRetryTextView(); } passwordEditText.setText(""); passwordEditText2.eraseAllCharacters(true); onPasscodeError(); return; } } SharedConfig.badPasscodeTries = 0; passwordEditText.clearFocus(); AndroidUtilities.hideKeyboard(passwordEditText); AnimatorSet AnimatorSet = new AnimatorSet(); AnimatorSet.setDuration(200); AnimatorSet.playTogether( ObjectAnimator.ofFloat(this, "translationY", AndroidUtilities.dp(20)), ObjectAnimator.ofFloat(this, "alpha", AndroidUtilities.dp(0.0f))); AnimatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setVisibility(View.GONE); } }); AnimatorSet.start(); SharedConfig.appLocked = false; SharedConfig.saveConfig(); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetPasscode); setOnTouchListener(null); if (delegate != null) { delegate.didAcceptedPassword(); } }
Example 3
Source File: PasscodeView.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
private void processDone(boolean fingerprint) { if (!fingerprint) { if (SharedConfig.passcodeRetryInMs > 0) { return; } String password = ""; if (SharedConfig.passcodeType == 0) { password = passwordEditText2.getString(); } else if (SharedConfig.passcodeType == 1) { password = passwordEditText.getText().toString(); } if (password.length() == 0) { onPasscodeError(); return; } if (!SharedConfig.checkPasscode(password)) { SharedConfig.increaseBadPasscodeTries(); if (SharedConfig.passcodeRetryInMs > 0) { checkRetryTextView(); } passwordEditText.setText(""); passwordEditText2.eraseAllCharacters(true); onPasscodeError(); return; } } SharedConfig.badPasscodeTries = 0; passwordEditText.clearFocus(); AndroidUtilities.hideKeyboard(passwordEditText); AnimatorSet AnimatorSet = new AnimatorSet(); AnimatorSet.setDuration(200); AnimatorSet.playTogether( ObjectAnimator.ofFloat(this, View.TRANSLATION_Y, AndroidUtilities.dp(20)), ObjectAnimator.ofFloat(this, View.ALPHA, AndroidUtilities.dp(0.0f))); AnimatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setVisibility(View.GONE); } }); AnimatorSet.start(); SharedConfig.appLocked = false; SharedConfig.saveConfig(); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetPasscode); setOnTouchListener(null); if (delegate != null) { delegate.didAcceptedPassword(); } }
Example 4
Source File: PasscodeView.java From Telegram with GNU General Public License v2.0 | 4 votes |
private void processDone(boolean fingerprint) { if (!fingerprint) { if (SharedConfig.passcodeRetryInMs > 0) { return; } String password = ""; if (SharedConfig.passcodeType == 0) { password = passwordEditText2.getString(); } else if (SharedConfig.passcodeType == 1) { password = passwordEditText.getText().toString(); } if (password.length() == 0) { onPasscodeError(); return; } if (!SharedConfig.checkPasscode(password)) { SharedConfig.increaseBadPasscodeTries(); if (SharedConfig.passcodeRetryInMs > 0) { checkRetryTextView(); } passwordEditText.setText(""); passwordEditText2.eraseAllCharacters(true); onPasscodeError(); return; } } SharedConfig.badPasscodeTries = 0; passwordEditText.clearFocus(); AndroidUtilities.hideKeyboard(passwordEditText); AnimatorSet AnimatorSet = new AnimatorSet(); AnimatorSet.setDuration(200); AnimatorSet.playTogether( ObjectAnimator.ofFloat(this, View.TRANSLATION_Y, AndroidUtilities.dp(20)), ObjectAnimator.ofFloat(this, View.ALPHA, AndroidUtilities.dp(0.0f))); AnimatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { setVisibility(View.GONE); } }); AnimatorSet.start(); SharedConfig.appLocked = false; SharedConfig.saveConfig(); NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.didSetPasscode); setOnTouchListener(null); if (delegate != null) { delegate.didAcceptedPassword(); } }