mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-27 17:26:09 +00:00
24 lines
720 B
Java
24 lines
720 B
Java
package com.beemdevelopment.aegis.helpers;
|
|
|
|
import android.text.Editable;
|
|
import android.widget.EditText;
|
|
|
|
import java.util.Arrays;
|
|
|
|
public class EditTextHelper {
|
|
private EditTextHelper() {
|
|
}
|
|
|
|
public static char[] getEditTextChars(EditText text) {
|
|
Editable editable = text.getText();
|
|
char[] chars = new char[editable.length()];
|
|
editable.getChars(0, editable.length(), chars, 0);
|
|
return chars;
|
|
}
|
|
|
|
public static boolean areEditTextsEqual(EditText text1, EditText text2) {
|
|
char[] password = getEditTextChars(text1);
|
|
char[] passwordConfirm = getEditTextChars(text2);
|
|
return password.length != 0 && Arrays.equals(password, passwordConfirm);
|
|
}
|
|
}
|