refactor constants name with uppercased ones

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parneet-guraya 2024-10-20 21:05:54 +05:30
parent f26b651f54
commit d957f2110a
No known key found for this signature in database
GPG key ID: 63B807C4B2A9064B
2 changed files with 9 additions and 9 deletions

View file

@ -306,10 +306,10 @@ class CommonsApplication : MultiDexApplication() {
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
if (loginMessage != null) { if (loginMessage != null) {
loginIntent.putExtra(loginMessageIntentKey, loginMessage) loginIntent.putExtra(LOGIN_MESSAGE_INTENT_KEY, loginMessage)
} }
if (userName != null) { if (userName != null) {
loginIntent.putExtra(loginUsernameIntentKey, userName) loginIntent.putExtra(LOGIN_USERNAME_INTENT_KEY, userName)
} }
ctx.startActivity(loginIntent) ctx.startActivity(loginIntent)
@ -356,9 +356,9 @@ class CommonsApplication : MultiDexApplication() {
} }
companion object { companion object {
//TODO should be uppercase
const val loginMessageIntentKey: String = "loginMessage" const val LOGIN_MESSAGE_INTENT_KEY: String = "loginMessage"
const val loginUsernameIntentKey: String = "loginUsername" const val LOGIN_USERNAME_INTENT_KEY: String = "loginUsername"
const val IS_LIMITED_CONNECTION_MODE_ENABLED: String = "is_limited_connection_mode_enabled" const val IS_LIMITED_CONNECTION_MODE_ENABLED: String = "is_limited_connection_mode_enabled"

View file

@ -50,8 +50,8 @@ import timber.log.Timber;
import static android.view.KeyEvent.KEYCODE_ENTER; import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.View.VISIBLE; import static android.view.View.VISIBLE;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE; import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static fr.free.nrw.commons.CommonsApplication.loginMessageIntentKey; import static fr.free.nrw.commons.CommonsApplication.LOGIN_MESSAGE_INTENT_KEY;
import static fr.free.nrw.commons.CommonsApplication.loginUsernameIntentKey; import static fr.free.nrw.commons.CommonsApplication.LOGIN_USERNAME_INTENT_KEY;
public class LoginActivity extends AccountAuthenticatorActivity { public class LoginActivity extends AccountAuthenticatorActivity {
@ -94,8 +94,8 @@ public class LoginActivity extends AccountAuthenticatorActivity {
binding = ActivityLoginBinding.inflate(getLayoutInflater()); binding = ActivityLoginBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot()); setContentView(binding.getRoot());
String message = getIntent().getStringExtra(loginMessageIntentKey); String message = getIntent().getStringExtra(LOGIN_MESSAGE_INTENT_KEY);
String username = getIntent().getStringExtra(loginUsernameIntentKey); String username = getIntent().getStringExtra(LOGIN_USERNAME_INTENT_KEY);
binding.loginUsername.addTextChangedListener(textWatcher); binding.loginUsername.addTextChangedListener(textWatcher);
binding.loginPassword.addTextChangedListener(textWatcher); binding.loginPassword.addTextChangedListener(textWatcher);