|
|
@ -119,7 +119,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
dobContainerOnClickGestureDetector = new RegisterDobClickGestureDetector(); |
|
|
|
dobConatinerClickGestureDetector = new GestureDetectorCompat(this, dobContainerOnClickGestureDetector); |
|
|
|
|
|
|
|
securityKeyboardPasswordListener=new SecurityKeypadPasswordListener(); |
|
|
|
securityKeyboardPasswordListener = new SecurityKeypadPasswordListener(); |
|
|
|
securityKeyboardPasswordView.setKeyboardContainerView(keypadContainer); |
|
|
|
securityKeyboardPasswordView.setKeyboardBallonView(ballonView); |
|
|
|
try { |
|
|
@ -141,7 +141,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
Log.d("GMESecurityKeyboard", e.getMessage()); |
|
|
|
} |
|
|
|
|
|
|
|
securityKeyboardConfirmPasswordListener=new SecurityKeypadConfirmPasswordListener(); |
|
|
|
securityKeyboardConfirmPasswordListener = new SecurityKeypadConfirmPasswordListener(); |
|
|
|
securityKeyboardConfirmPasswordView.setKeyboardContainerView(keypadContainer); |
|
|
|
securityKeyboardConfirmPasswordView.setKeyboardBallonView(ballonView); |
|
|
|
try { |
|
|
@ -192,7 +192,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean dispatchTouchEvent(MotionEvent ev) { |
|
|
|
return (securityKeyboardPasswordView.checkIfTouchIntersectKeypadLayout(ev)||securityKeyboardConfirmPasswordView.checkIfTouchIntersectKeypadLayout(ev)||dobConatinerClickGestureDetector.onTouchEvent(ev)|| super.dispatchTouchEvent(ev)); |
|
|
|
return (securityKeyboardPasswordView.checkIfTouchIntersectKeypadLayout(ev) || securityKeyboardConfirmPasswordView.checkIfTouchIntersectKeypadLayout(ev) || dobConatinerClickGestureDetector.onTouchEvent(ev) || super.dispatchTouchEvent(ev)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -283,6 +283,15 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onBackPressed() { |
|
|
|
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible()) |
|
|
|
securityKeyboardPasswordManager.hideKeyboard(); |
|
|
|
else if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible()) |
|
|
|
securityKeyboardConfirmPasswordManager.hideKeyboard(); |
|
|
|
else |
|
|
|
super.onBackPressed(); |
|
|
|
} |
|
|
|
|
|
|
|
class RegisterDobClickGestureDetector extends GestureDetector.SimpleOnGestureListener { |
|
|
|
@Override |
|
|
@ -315,20 +324,23 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
class SecurityKeypadPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener { |
|
|
|
class SecurityKeypadPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade, SecurityKeyboardView.SecurityKeyboardFocusStateListener { |
|
|
|
@Override |
|
|
|
public void done(Intent intent) { |
|
|
|
presenter.updatePassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent)); |
|
|
|
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA); |
|
|
|
Log.d("RegisterScreen", encryptedText); |
|
|
|
presenter.updatePassword(intent.getStringExtra(encryptedText), getDecryptedDataFromIntent(intent)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void cancel(Intent intent) { |
|
|
|
presenter.updatePassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent)); |
|
|
|
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA); |
|
|
|
Log.d("RegisterScreen", encryptedText); |
|
|
|
presenter.updatePassword(encryptedText, getDecryptedDataFromIntent(intent)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getDecryptedDataFromIntent(Intent intent) |
|
|
|
{ |
|
|
|
private String getDecryptedDataFromIntent(Intent intent) { |
|
|
|
if (intent == null) |
|
|
|
return ""; |
|
|
|
|
|
|
@ -336,8 +348,8 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
byte[] secureKey = intent.getByteArrayExtra(TransKeyActivity.mTK_PARAM_SECURE_KEY); |
|
|
|
int iRealDataLength = intent.getIntExtra(TransKeyActivity.mTK_PARAM_DATA_LENGTH, 0); |
|
|
|
Log.d("EncryptedData",cipherData); |
|
|
|
return EncryptionManager.decryptCipherText(cipherData,secureKey,iRealDataLength); |
|
|
|
Log.d("EncryptedData", cipherData); |
|
|
|
return EncryptionManager.decryptCipherText(cipherData, secureKey, iRealDataLength); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -358,12 +370,13 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onSecurityViewRecievedFocus() { |
|
|
|
hideKeyboardFromRemainingWidget(); |
|
|
|
if (securityKeyboardPasswordManager != null && !securityKeyboardPasswordManager.isKeyboardVisible()) { |
|
|
|
hideKeyBoard(); |
|
|
|
securityKeyboardPasswordManager.showKeyboard(); |
|
|
|
scrollView.postDelayed(()->{ |
|
|
|
scrollView.postDelayed(() -> { |
|
|
|
scrollView.smoothScrollTo(0, passwordTextView.getTop()); |
|
|
|
},250); |
|
|
|
}, 250); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -372,27 +385,37 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
public void onSecurityViewLostFocus() { |
|
|
|
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible()) { |
|
|
|
securityKeyboardPasswordManager.hideKeyboard(); |
|
|
|
Log.d("RegisterScreen","PasswordKeyboard Hide"); |
|
|
|
} |
|
|
|
else |
|
|
|
Log.d("RegisterScreen", "PasswordKeyboard Hide"); |
|
|
|
} else |
|
|
|
hideKeyBoard(); |
|
|
|
} |
|
|
|
|
|
|
|
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false |
|
|
|
private void hideKeyboardFromRemainingWidget() { |
|
|
|
if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible()) |
|
|
|
securityKeyboardConfirmPasswordManager.hideKeyboard(); |
|
|
|
} |
|
|
|
class SecurityKeypadConfirmPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade,SecurityKeyboardView.SecurityKeyboardFocusStateListener { |
|
|
|
} |
|
|
|
|
|
|
|
class SecurityKeypadConfirmPasswordListener implements SecurityKeyboardManager.SecurityKeyboardActionListenerFacade, SecurityKeyboardView.SecurityKeyboardFocusStateListener { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void done(Intent intent) { |
|
|
|
presenter.updateConfirmPassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent)); |
|
|
|
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA); |
|
|
|
Log.d("RegisterScreen", encryptedText); |
|
|
|
presenter.updateConfirmPassword(encryptedText, getDecryptedDataFromIntent(intent)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void cancel(Intent intent) { |
|
|
|
presenter.updateConfirmPassword(intent.getStringExtra(TransKeyActivity.mTK_PARAM_CIPHER_DATA),getDecryptedDataFromIntent(intent)); |
|
|
|
String encryptedText = intent.getStringExtra(TransKeyActivity.mTK_PARAM_SECURE_DATA); |
|
|
|
Log.d("RegisterScreen", encryptedText); |
|
|
|
presenter.updateConfirmPassword(encryptedText, getDecryptedDataFromIntent(intent)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getDecryptedDataFromIntent(Intent intent) |
|
|
|
{ |
|
|
|
private String getDecryptedDataFromIntent(Intent intent) { |
|
|
|
if (intent == null) |
|
|
|
return ""; |
|
|
|
|
|
|
@ -400,8 +423,7 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
byte[] secureKey = intent.getByteArrayExtra(TransKeyActivity.mTK_PARAM_SECURE_KEY); |
|
|
|
int iRealDataLength = intent.getIntExtra(TransKeyActivity.mTK_PARAM_DATA_LENGTH, 0); |
|
|
|
Log.d("EncryptedData",cipherData); |
|
|
|
return EncryptionManager.decryptCipherText(cipherData,secureKey,iRealDataLength); |
|
|
|
return EncryptionManager.decryptCipherText(cipherData, secureKey, iRealDataLength); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -422,13 +444,14 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onSecurityViewRecievedFocus() { |
|
|
|
hideKeyboardFromRemainingWidget(); |
|
|
|
if (securityKeyboardConfirmPasswordManager != null && !securityKeyboardConfirmPasswordManager.isKeyboardVisible()) { |
|
|
|
|
|
|
|
hideKeyBoard(); |
|
|
|
securityKeyboardConfirmPasswordManager.showKeyboard(); |
|
|
|
scrollView.postDelayed(()->{ |
|
|
|
scrollView.postDelayed(() -> { |
|
|
|
scrollView.smoothScrollTo(0, confirmPasswordTextView.getTop()); |
|
|
|
},250); |
|
|
|
}, 250); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -437,10 +460,15 @@ public class RegisterV2Activity extends BaseActivity implements RegisterV2Presen |
|
|
|
public void onSecurityViewLostFocus() { |
|
|
|
if (securityKeyboardConfirmPasswordManager != null && securityKeyboardConfirmPasswordManager.isKeyboardVisible()) { |
|
|
|
securityKeyboardConfirmPasswordManager.hideKeyboard(); |
|
|
|
Log.d("RegisterScreen","PasswordConfirmKeyboard Hide"); |
|
|
|
} |
|
|
|
else |
|
|
|
Log.d("RegisterScreen", "PasswordConfirmKeyboard Hide"); |
|
|
|
} else |
|
|
|
hideKeyBoard(); |
|
|
|
} |
|
|
|
|
|
|
|
//In some cases remaining keyboard widget may still be focusable as our layout can be scrolled for which the on screen location of remaining widget may be false |
|
|
|
private void hideKeyboardFromRemainingWidget() { |
|
|
|
if (securityKeyboardPasswordManager != null && securityKeyboardPasswordManager.isKeyboardVisible()) |
|
|
|
securityKeyboardPasswordManager.hideKeyboard(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |