From 6e9c16a8894e38509e39492e60546763f87a6f46 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 16 Apr 2021 09:52:30 +0200 Subject: [PATCH] Naming convention --- .../im/vector/app/core/di/FragmentModule.kt | 30 +++++++++---------- .../app/features/login2/LoginActivity2.kt | 12 ++++---- ...ord.kt => LoginFragmentSigninPassword2.kt} | 11 ++++--- ...ame.kt => LoginFragmentSigninUsername2.kt} | 8 ++--- ...ord.kt => LoginFragmentSignupPassword2.kt} | 10 +++---- ...ame.kt => LoginFragmentSignupUsername2.kt} | 10 +++---- .../features/login2/LoginFragmentToAny2.kt | 8 ++--- .../LoginGenericTextInputFormFragment2.kt | 21 +++---------- ...inSplashSignUpSignInSelectionFragment2.kt} | 2 +- ...l => fragment_login_signin_password_2.xml} | 0 ...xml => fragment_login_signin_to_any_2.xml} | 0 ...l => fragment_login_signin_username_2.xml} | 0 ...l => fragment_login_signup_password_2.xml} | 0 ...l => fragment_login_signup_username_2.xml} | 0 14 files changed, 50 insertions(+), 62 deletions(-) rename vector/src/main/java/im/vector/app/features/login2/{LoginFragment2SigninPassword.kt => LoginFragmentSigninPassword2.kt} (94%) rename vector/src/main/java/im/vector/app/features/login2/{LoginFragment2SigninUsername.kt => LoginFragmentSigninUsername2.kt} (91%) rename vector/src/main/java/im/vector/app/features/login2/{LoginFragment2SignupPassword.kt => LoginFragmentSignupPassword2.kt} (92%) rename vector/src/main/java/im/vector/app/features/login2/{LoginFragment2SignupUsername.kt => LoginFragmentSignupUsername2.kt} (92%) rename vector/src/main/java/im/vector/app/features/login2/{LoginSignUpSignInSelectionFragment2.kt => LoginSplashSignUpSignInSelectionFragment2.kt} (97%) rename vector/src/main/res/layout/{fragment_login_2_signin_password.xml => fragment_login_signin_password_2.xml} (100%) rename vector/src/main/res/layout/{fragment_login_2_signin_to.xml => fragment_login_signin_to_any_2.xml} (100%) rename vector/src/main/res/layout/{fragment_login_2_signin_username.xml => fragment_login_signin_username_2.xml} (100%) rename vector/src/main/res/layout/{fragment_login_2_signup_password.xml => fragment_login_signup_password_2.xml} (100%) rename vector/src/main/res/layout/{fragment_login_2_signup_username.xml => fragment_login_signup_username_2.xml} (100%) diff --git a/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt b/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt index aef61f3bc0..75c0974908 100644 --- a/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt +++ b/vector/src/main/java/im/vector/app/core/di/FragmentModule.kt @@ -72,10 +72,10 @@ import im.vector.app.features.login.LoginWaitForEmailFragment import im.vector.app.features.login.LoginWebFragment import im.vector.app.features.login.terms.LoginTermsFragment import im.vector.app.features.login2.LoginCaptchaFragment2 -import im.vector.app.features.login2.LoginFragment2SigninPassword -import im.vector.app.features.login2.LoginFragment2SigninUsername -import im.vector.app.features.login2.LoginFragment2SignupPassword -import im.vector.app.features.login2.LoginFragment2SignupUsername +import im.vector.app.features.login2.LoginFragmentSigninPassword2 +import im.vector.app.features.login2.LoginFragmentSigninUsername2 +import im.vector.app.features.login2.LoginFragmentSignupPassword2 +import im.vector.app.features.login2.LoginFragmentSignupUsername2 import im.vector.app.features.login2.created.AccountCreatedFragment import im.vector.app.features.login2.LoginFragmentToAny2 import im.vector.app.features.login2.LoginGenericTextInputFormFragment2 @@ -84,7 +84,7 @@ import im.vector.app.features.login2.LoginResetPasswordMailConfirmationFragment2 import im.vector.app.features.login2.LoginResetPasswordSuccessFragment2 import im.vector.app.features.login2.LoginServerSelectionFragment2 import im.vector.app.features.login2.LoginServerUrlFormFragment2 -import im.vector.app.features.login2.LoginSignUpSignInSelectionFragment2 +import im.vector.app.features.login2.LoginSplashSignUpSignInSelectionFragment2 import im.vector.app.features.login2.LoginSsoOnlyFragment2 import im.vector.app.features.login2.LoginWaitForEmailFragment2 import im.vector.app.features.login2.LoginWebFragment2 @@ -284,8 +284,8 @@ interface FragmentModule { @Binds @IntoMap - @FragmentKey(LoginFragment2SigninUsername::class) - fun bindLoginFragment2SigninUsername(fragment: LoginFragment2SigninUsername): Fragment + @FragmentKey(LoginFragmentSigninUsername2::class) + fun bindLoginFragmentSigninUsername2(fragment: LoginFragmentSigninUsername2): Fragment @Binds @IntoMap @@ -294,18 +294,18 @@ interface FragmentModule { @Binds @IntoMap - @FragmentKey(LoginFragment2SignupUsername::class) - fun bindLoginFragment2SignupUsername(fragment: LoginFragment2SignupUsername): Fragment + @FragmentKey(LoginFragmentSignupUsername2::class) + fun bindLoginFragmentSignupUsername2(fragment: LoginFragmentSignupUsername2): Fragment @Binds @IntoMap - @FragmentKey(LoginFragment2SigninPassword::class) - fun bindLoginFragment2SigninPassword(fragment: LoginFragment2SigninPassword): Fragment + @FragmentKey(LoginFragmentSigninPassword2::class) + fun bindLoginFragmentSigninPassword2(fragment: LoginFragmentSigninPassword2): Fragment @Binds @IntoMap - @FragmentKey(LoginFragment2SignupPassword::class) - fun bindLoginFragment2SignupPassword(fragment: LoginFragment2SignupPassword): Fragment + @FragmentKey(LoginFragmentSignupPassword2::class) + fun bindLoginFragmentSignupPassword2(fragment: LoginFragmentSignupPassword2): Fragment @Binds @IntoMap @@ -354,8 +354,8 @@ interface FragmentModule { @Binds @IntoMap - @FragmentKey(LoginSignUpSignInSelectionFragment2::class) - fun bindLoginSignUpSignInSelectionFragment2(fragment: LoginSignUpSignInSelectionFragment2): Fragment + @FragmentKey(LoginSplashSignUpSignInSelectionFragment2::class) + fun bindLoginSplashSignUpSignInSelectionFragment2(fragment: LoginSplashSignUpSignInSelectionFragment2): Fragment @Binds @IntoMap diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginActivity2.kt b/vector/src/main/java/im/vector/app/features/login2/LoginActivity2.kt index 43dfb5cec6..f5663c1f5a 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginActivity2.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginActivity2.kt @@ -43,7 +43,9 @@ import im.vector.app.databinding.ActivityLoginBinding import im.vector.app.features.home.HomeActivity import im.vector.app.features.login.LoginCaptchaFragmentArgument import im.vector.app.features.login.LoginConfig +import im.vector.app.features.login.LoginGenericTextInputFormFragmentArgument import im.vector.app.features.login.LoginWaitForEmailFragmentArgument +import im.vector.app.features.login.TextInputFormFragmentMode import im.vector.app.features.login.isSupported import im.vector.app.features.login.terms.LoginTermsFragmentArgument import im.vector.app.features.login.terms.toLocalizedLoginTerms @@ -115,7 +117,7 @@ open class LoginActivity2 : VectorBaseActivity(), ToolbarC } protected open fun addFirstFragment() { - addFragment(R.id.loginFragmentContainer, LoginSignUpSignInSelectionFragment2::class.java) + addFragment(R.id.loginFragmentContainer, LoginSplashSignUpSignInSelectionFragment2::class.java) } private fun handleLoginViewEvents(event: LoginViewEvents2) { @@ -171,7 +173,7 @@ open class LoginActivity2 : VectorBaseActivity(), ToolbarC } is LoginViewEvents2.OpenSignInEnterIdentifierScreen -> { addFragmentToBackstack(R.id.loginFragmentContainer, - LoginFragment2SigninUsername::class.java, + LoginFragmentSigninUsername2::class.java, option = { ft -> findViewById(R.id.loginSplashLogo)?.let { ft.addSharedElement(it, ViewCompat.getTransitionName(it) ?: "") } // Disable transition of text @@ -216,19 +218,19 @@ open class LoginActivity2 : VectorBaseActivity(), ToolbarC option = commonOption) is LoginViewEvents2.OpenSigninPasswordScreen -> { addFragmentToBackstack(R.id.loginFragmentContainer, - LoginFragment2SigninPassword::class.java, + LoginFragmentSigninPassword2::class.java, tag = FRAGMENT_LOGIN_TAG, option = commonOption) } is LoginViewEvents2.OpenSignupPasswordScreen -> { addFragmentToBackstack(R.id.loginFragmentContainer, - LoginFragment2SignupPassword::class.java, + LoginFragmentSignupPassword2::class.java, tag = FRAGMENT_REGISTRATION_STAGE_TAG, option = commonOption) } is LoginViewEvents2.OpenSignUpChooseUsernameScreen -> { addFragmentToBackstack(R.id.loginFragmentContainer, - LoginFragment2SignupUsername::class.java, + LoginFragmentSignupUsername2::class.java, tag = FRAGMENT_REGISTRATION_STAGE_TAG, option = commonOption) } diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninPassword.kt b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninPassword2.kt similarity index 94% rename from vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninPassword.kt rename to vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninPassword2.kt index 6428a15691..a13905cc5f 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninPassword.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninPassword2.kt @@ -29,7 +29,7 @@ import com.jakewharton.rxbinding3.widget.textChanges import im.vector.app.R import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.showPassword -import im.vector.app.databinding.FragmentLogin2SigninPasswordBinding +import im.vector.app.databinding.FragmentLoginSigninPassword2Binding import im.vector.app.features.home.AvatarRenderer import io.reactivex.rxkotlin.subscribeBy import org.matrix.android.sdk.api.auth.login.LoginProfileInfo @@ -40,18 +40,17 @@ import javax.net.ssl.HttpsURLConnection /** * In this screen: - * In signin mode: * - the user is asked for password to sign in to a homeserver. * - He also can reset his password */ -class LoginFragment2SigninPassword @Inject constructor( +class LoginFragmentSigninPassword2 @Inject constructor( private val avatarRenderer: AvatarRenderer -) : AbstractSSOLoginFragment2() { +) : AbstractSSOLoginFragment2() { private var passwordShown = false - override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLogin2SigninPasswordBinding { - return FragmentLogin2SigninPasswordBinding.inflate(inflater, container, false) + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSigninPassword2Binding { + return FragmentLoginSigninPassword2Binding.inflate(inflater, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninUsername.kt b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninUsername2.kt similarity index 91% rename from vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninUsername.kt rename to vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninUsername2.kt index 1624e641a8..10fe0aae3a 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SigninUsername.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSigninUsername2.kt @@ -25,7 +25,7 @@ import androidx.autofill.HintConstants import com.jakewharton.rxbinding3.widget.textChanges import im.vector.app.R import im.vector.app.core.extensions.hideKeyboard -import im.vector.app.databinding.FragmentLogin2SigninUsernameBinding +import im.vector.app.databinding.FragmentLoginSigninUsername2Binding import io.reactivex.rxkotlin.subscribeBy import org.matrix.android.sdk.api.failure.Failure import org.matrix.android.sdk.api.failure.MatrixError @@ -35,10 +35,10 @@ import javax.inject.Inject * In this screen: * - the user is asked for its matrix ID, and have the possibility to open the screen to select a server */ -class LoginFragment2SigninUsername @Inject constructor() : AbstractLoginFragment2() { +class LoginFragmentSigninUsername2 @Inject constructor() : AbstractLoginFragment2() { - override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLogin2SigninUsernameBinding { - return FragmentLogin2SigninUsernameBinding.inflate(inflater, container, false) + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSigninUsername2Binding { + return FragmentLoginSigninUsername2Binding.inflate(inflater, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupPassword.kt b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupPassword2.kt similarity index 92% rename from vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupPassword.kt rename to vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupPassword2.kt index 372d5dad79..49f4a4efc0 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupPassword.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupPassword2.kt @@ -27,21 +27,21 @@ import com.jakewharton.rxbinding3.widget.textChanges import im.vector.app.R import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.showPassword -import im.vector.app.databinding.FragmentLogin2SignupPasswordBinding +import im.vector.app.databinding.FragmentLoginSignupPassword2Binding import io.reactivex.rxkotlin.Observables import io.reactivex.rxkotlin.subscribeBy import javax.inject.Inject /** * In this screen: - * - the user is asked for password to sign up to a homeserver. + * - the user is asked to choose a password to sign up to a homeserver. */ -class LoginFragment2SignupPassword @Inject constructor() : AbstractSSOLoginFragment2() { +class LoginFragmentSignupPassword2 @Inject constructor() : AbstractSSOLoginFragment2() { private var passwordsShown = false - override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLogin2SignupPasswordBinding { - return FragmentLogin2SignupPasswordBinding.inflate(inflater, container, false) + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSignupPassword2Binding { + return FragmentLoginSignupPassword2Binding.inflate(inflater, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupUsername.kt b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupUsername2.kt similarity index 92% rename from vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupUsername.kt rename to vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupUsername2.kt index 92bd041da9..9726d8b163 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginFragment2SignupUsername.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentSignupUsername2.kt @@ -29,7 +29,7 @@ import com.jakewharton.rxbinding3.widget.textChanges import im.vector.app.R import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.toReducedUrl -import im.vector.app.databinding.FragmentLogin2SignupUsernameBinding +import im.vector.app.databinding.FragmentLoginSignupUsername2Binding import im.vector.app.features.login.LoginMode import im.vector.app.features.login.SocialLoginButtonsView import io.reactivex.rxkotlin.subscribeBy @@ -37,17 +37,17 @@ import javax.inject.Inject /** * In this screen: - * - the user is asked for login to sign up to a homeserver. + * - the user is asked for an identifier to sign up to a homeserver. * - SSO option are displayed if available */ -class LoginFragment2SignupUsername @Inject constructor() : AbstractSSOLoginFragment2() { +class LoginFragmentSignupUsername2 @Inject constructor() : AbstractSSOLoginFragment2() { // Temporary patch for https://github.com/vector-im/riotX-android/issues/1410, // waiting for https://github.com/matrix-org/synapse/issues/7576 private var isNumericOnlyUserIdForbidden = false - override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLogin2SignupUsernameBinding { - return FragmentLogin2SignupUsernameBinding.inflate(inflater, container, false) + override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentLoginSignupUsername2Binding { + return FragmentLoginSignupUsername2Binding.inflate(inflater, container, false) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginFragmentToAny2.kt b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentToAny2.kt index 479902a803..ab5e3f15b8 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginFragmentToAny2.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginFragmentToAny2.kt @@ -30,7 +30,7 @@ import im.vector.app.R import im.vector.app.core.extensions.hideKeyboard import im.vector.app.core.extensions.showPassword import im.vector.app.core.extensions.toReducedUrl -import im.vector.app.databinding.FragmentLogin2SigninToBinding +import im.vector.app.databinding.FragmentLoginSigninToAny2Binding import im.vector.app.features.login.LoginMode import im.vector.app.features.login.SocialLoginButtonsView import io.reactivex.Observable @@ -47,7 +47,7 @@ import javax.inject.Inject * - He also can reset his password * - It also possible to use SSO if server support it in this screen */ -class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2() { +class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2() { private var passwordShown = false @@ -55,8 +55,8 @@ class LoginFragmentToAny2 @Inject constructor() : AbstractSSOLoginFragment2= Build.VERSION_CODES.O) { views.loginGenericTextInputFormTextInput.setAutofillHints( when (params.mode) { - TextInputFormFragmentMode.SetEmail -> HintConstants.AUTOFILL_HINT_EMAIL_ADDRESS - TextInputFormFragmentMode.SetMsisdn -> HintConstants.AUTOFILL_HINT_PHONE_NUMBER + TextInputFormFragmentMode.SetEmail -> HintConstants.AUTOFILL_HINT_EMAIL_ADDRESS + TextInputFormFragmentMode.SetMsisdn -> HintConstants.AUTOFILL_HINT_PHONE_NUMBER TextInputFormFragmentMode.ConfirmMsisdn -> HintConstants.AUTOFILL_HINT_SMS_OTP } ) diff --git a/vector/src/main/java/im/vector/app/features/login2/LoginSignUpSignInSelectionFragment2.kt b/vector/src/main/java/im/vector/app/features/login2/LoginSplashSignUpSignInSelectionFragment2.kt similarity index 97% rename from vector/src/main/java/im/vector/app/features/login2/LoginSignUpSignInSelectionFragment2.kt rename to vector/src/main/java/im/vector/app/features/login2/LoginSplashSignUpSignInSelectionFragment2.kt index a5e72bfc18..6cfebf776a 100644 --- a/vector/src/main/java/im/vector/app/features/login2/LoginSignUpSignInSelectionFragment2.kt +++ b/vector/src/main/java/im/vector/app/features/login2/LoginSplashSignUpSignInSelectionFragment2.kt @@ -31,7 +31,7 @@ import javax.inject.Inject * In this screen, the user is asked to sign up or to sign in to the homeserver * This is the new splash screen */ -class LoginSignUpSignInSelectionFragment2 @Inject constructor( +class LoginSplashSignUpSignInSelectionFragment2 @Inject constructor( private val vectorPreferences: VectorPreferences ) : AbstractLoginFragment2() { diff --git a/vector/src/main/res/layout/fragment_login_2_signin_password.xml b/vector/src/main/res/layout/fragment_login_signin_password_2.xml similarity index 100% rename from vector/src/main/res/layout/fragment_login_2_signin_password.xml rename to vector/src/main/res/layout/fragment_login_signin_password_2.xml diff --git a/vector/src/main/res/layout/fragment_login_2_signin_to.xml b/vector/src/main/res/layout/fragment_login_signin_to_any_2.xml similarity index 100% rename from vector/src/main/res/layout/fragment_login_2_signin_to.xml rename to vector/src/main/res/layout/fragment_login_signin_to_any_2.xml diff --git a/vector/src/main/res/layout/fragment_login_2_signin_username.xml b/vector/src/main/res/layout/fragment_login_signin_username_2.xml similarity index 100% rename from vector/src/main/res/layout/fragment_login_2_signin_username.xml rename to vector/src/main/res/layout/fragment_login_signin_username_2.xml diff --git a/vector/src/main/res/layout/fragment_login_2_signup_password.xml b/vector/src/main/res/layout/fragment_login_signup_password_2.xml similarity index 100% rename from vector/src/main/res/layout/fragment_login_2_signup_password.xml rename to vector/src/main/res/layout/fragment_login_signup_password_2.xml diff --git a/vector/src/main/res/layout/fragment_login_2_signup_username.xml b/vector/src/main/res/layout/fragment_login_signup_username_2.xml similarity index 100% rename from vector/src/main/res/layout/fragment_login_2_signup_username.xml rename to vector/src/main/res/layout/fragment_login_signup_username_2.xml