diff --git a/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt index 45305cd07..fff4e3cef 100644 --- a/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt +++ b/app/src/main/java/com/github/libretube/ui/dialogs/LoginDialog.kt @@ -3,6 +3,7 @@ package com.github.libretube.ui.dialogs import android.app.Dialog import android.os.Bundle import android.util.Log +import android.util.Patterns import android.widget.Toast import androidx.fragment.app.DialogFragment import androidx.lifecycle.lifecycleScope @@ -14,7 +15,6 @@ import com.github.libretube.api.obj.Token import com.github.libretube.databinding.DialogLoginBinding import com.github.libretube.extensions.TAG import com.github.libretube.helpers.PreferenceHelper -import com.github.libretube.util.TextUtils import com.google.android.material.dialog.MaterialAlertDialogBuilder import kotlinx.serialization.decodeFromString import retrofit2.HttpException @@ -113,6 +113,6 @@ class LoginDialog( } private fun isEmail(text: String): Boolean { - return TextUtils.EMAIL_REGEX.toRegex().matches(text) + return Patterns.EMAIL_ADDRESS.toRegex().matches(text) } } diff --git a/app/src/main/java/com/github/libretube/util/TextUtils.kt b/app/src/main/java/com/github/libretube/util/TextUtils.kt index 26d29d5f9..1ee9ead11 100644 --- a/app/src/main/java/com/github/libretube/util/TextUtils.kt +++ b/app/src/main/java/com/github/libretube/util/TextUtils.kt @@ -14,11 +14,6 @@ object TextUtils { */ const val SEPARATOR = " • " - /** - * Regex to check for e-mails - */ - const val EMAIL_REGEX = "^[A-Za-z](.*)([@]{1})(.{1,})(\\.)(.{1,})" - /** * Reserved characters by unix which can not be used for file name. */