// Path: backbone/src/main/java/org/researchstack/backbone/utils/TextUtils.java
// public class TextUtils {
//     public static final Pattern EMAIL_ADDRESS = Pattern.compile(
//             "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
//                     "\\@" +
//                     "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
//                     "(" +
//                     "\\." +
//                     "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
//                     ")+");
// 
//     private TextUtils() {
//     }
// 
//     /**
//      * Returns true if the string is null or 0-length.
//      *
//      * @param str the string to be examined
//      * @return true if str is null or zero length
//      */
//     public static boolean isEmpty(CharSequence str) {
//         if (str == null || str.length() == 0) {
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     /**
//      * Returns true if the char sequence is a valid email address
//      *
//      * @param text the email address to be validated
//      * @return a boolean indicating whether the email is valid
//      */
//     public static boolean isValidEmail(CharSequence text) {
//         return !isEmpty(text) && EMAIL_ADDRESS.matcher(text).matches();
//     }
// 
// 
//     public static class AlphabeticFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isLetter(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// 
//     public static class NumericFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isDigit(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// 
//     public static class AlphanumericFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isLetterOrDigit(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// }


import android.text.InputFilter;
import android.text.InputType;
import android.text.format.DateUtils;
import org.researchstack.backbone.R;
import org.researchstack.backbone.utils.TextUtils;
    /**
     * Returns the amount of time in milliseconds that the user must be gone from the app for before
     * they are prompted for their pin code again.
     *
     * @return the lockout time
     */
    public long getPinAutoLockTime() {
        return autoLockTime;
    }

    /**
     * Sets the amount of time in milliseconds that the user must be gone from the app for before
     * they are prompted for their pin code again.
     * <p>
     * This may be a setting in your app, and therefore can be updated at any time.
     *
     * @param pinAutoLockTime the lockout time
     */
    public void setPinAutoLockTime(long pinAutoLockTime) {
        this.autoLockTime = pinAutoLockTime;
    }

    /**
     * General {@link Type}s that should cover most desired pin code configs: Alpha, Numeric, and
     * Alphanumberic.
     */
    public enum PinCodeType implements Type {
        Alphabetic(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS,
                InputType.TYPE_TEXT_VARIATION_NORMAL,
                InputType.TYPE_TEXT_VARIATION_PASSWORD,
// Path: backbone/src/main/java/org/researchstack/backbone/utils/TextUtils.java
// public class TextUtils {
//     public static final Pattern EMAIL_ADDRESS = Pattern.compile(
//             "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
//                     "\\@" +
//                     "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
//                     "(" +
//                     "\\." +
//                     "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
//                     ")+");
// 
//     private TextUtils() {
//     }
// 
//     /**
//      * Returns true if the string is null or 0-length.
//      *
//      * @param str the string to be examined
//      * @return true if str is null or zero length
//      */
//     public static boolean isEmpty(CharSequence str) {
//         if (str == null || str.length() == 0) {
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     /**
//      * Returns true if the char sequence is a valid email address
//      *
//      * @param text the email address to be validated
//      * @return a boolean indicating whether the email is valid
//      */
//     public static boolean isValidEmail(CharSequence text) {
//         return !isEmpty(text) && EMAIL_ADDRESS.matcher(text).matches();
//     }
// 
// 
//     public static class AlphabeticFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isLetter(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// 
//     public static class NumericFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isDigit(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// 
//     public static class AlphanumericFilter implements InputFilter {
//         @Override
//         public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//             for (int i = start; i < end; i++) {
//                 if (!Character.isLetterOrDigit(source.charAt(i))) {
//                     return "";
//                 }
//             }
//             return null;
//         }
//     }
// }


// Path: backbone/src/main/java/org/researchstack/backbone/storage/file/PinCodeConfig.java
import android.text.InputFilter;
import android.text.InputType;
import android.text.format.DateUtils;
import org.researchstack.backbone.R;
import org.researchstack.backbone.utils.TextUtils;

    /**
     * Returns the amount of time in milliseconds that the user must be gone from the app for before
     * they are prompted for their pin code again.
     *
     * @return the lockout time
     */
    public long getPinAutoLockTime() {
        return autoLockTime;
    }

    /**
     * Sets the amount of time in milliseconds that the user must be gone from the app for before
     * they are prompted for their pin code again.
     * <p>
     * This may be a setting in your app, and therefore can be updated at any time.
     *
     * @param pinAutoLockTime the lockout time
     */
    public void setPinAutoLockTime(long pinAutoLockTime) {
        this.autoLockTime = pinAutoLockTime;
    }

    /**
     * General {@link Type}s that should cover most desired pin code configs: Alpha, Numeric, and
     * Alphanumberic.
     */
    public enum PinCodeType implements Type {
        Alphabetic(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS,
                InputType.TYPE_TEXT_VARIATION_NORMAL,
                InputType.TYPE_TEXT_VARIATION_PASSWORD,
                new TextUtils.AlphabeticFilter()),