From d957f2110ab1b4e2bdc93304a0893b85c276339e Mon Sep 17 00:00:00 2001 From: parneet-guraya Date: Sun, 20 Oct 2024 21:05:54 +0530 Subject: [PATCH] refactor constants name with uppercased ones Signed-off-by: parneet-guraya --- .../java/fr/free/nrw/commons/CommonsApplication.kt | 10 +++++----- .../java/fr/free/nrw/commons/auth/LoginActivity.java | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.kt b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.kt index d44ba30c0..902f40c8a 100644 --- a/app/src/main/java/fr/free/nrw/commons/CommonsApplication.kt +++ b/app/src/main/java/fr/free/nrw/commons/CommonsApplication.kt @@ -306,10 +306,10 @@ class CommonsApplication : MultiDexApplication() { .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) if (loginMessage != null) { - loginIntent.putExtra(loginMessageIntentKey, loginMessage) + loginIntent.putExtra(LOGIN_MESSAGE_INTENT_KEY, loginMessage) } if (userName != null) { - loginIntent.putExtra(loginUsernameIntentKey, userName) + loginIntent.putExtra(LOGIN_USERNAME_INTENT_KEY, userName) } ctx.startActivity(loginIntent) @@ -356,9 +356,9 @@ class CommonsApplication : MultiDexApplication() { } companion object { - //TODO should be uppercase - const val loginMessageIntentKey: String = "loginMessage" - const val loginUsernameIntentKey: String = "loginUsername" + + const val LOGIN_MESSAGE_INTENT_KEY: String = "loginMessage" + const val LOGIN_USERNAME_INTENT_KEY: String = "loginUsername" const val IS_LIMITED_CONNECTION_MODE_ENABLED: String = "is_limited_connection_mode_enabled" diff --git a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java index 0b6d1831c..3ff61e511 100644 --- a/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/auth/LoginActivity.java @@ -50,8 +50,8 @@ import timber.log.Timber; import static android.view.KeyEvent.KEYCODE_ENTER; import static android.view.View.VISIBLE; import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE; -import static fr.free.nrw.commons.CommonsApplication.loginMessageIntentKey; -import static fr.free.nrw.commons.CommonsApplication.loginUsernameIntentKey; +import static fr.free.nrw.commons.CommonsApplication.LOGIN_MESSAGE_INTENT_KEY; +import static fr.free.nrw.commons.CommonsApplication.LOGIN_USERNAME_INTENT_KEY; public class LoginActivity extends AccountAuthenticatorActivity { @@ -94,8 +94,8 @@ public class LoginActivity extends AccountAuthenticatorActivity { binding = ActivityLoginBinding.inflate(getLayoutInflater()); setContentView(binding.getRoot()); - String message = getIntent().getStringExtra(loginMessageIntentKey); - String username = getIntent().getStringExtra(loginUsernameIntentKey); + String message = getIntent().getStringExtra(LOGIN_MESSAGE_INTENT_KEY); + String username = getIntent().getStringExtra(LOGIN_USERNAME_INTENT_KEY); binding.loginUsername.addTextChangedListener(textWatcher); binding.loginPassword.addTextChangedListener(textWatcher);