Remove redundant casts from findViewById.

This commit is contained in:
akwizgran
2017-10-11 18:22:14 +01:00
parent b56724dee5
commit 43ee3246f6
63 changed files with 218 additions and 232 deletions

View File

@@ -55,17 +55,17 @@ public class ChangePasswordActivityTest {
MockitoAnnotations.initMocks(this);
changePasswordActivity =
Robolectric.setupActivity(TestChangePasswordActivity.class);
passwordConfirmationWrapper = (TextInputLayout) changePasswordActivity
passwordConfirmationWrapper = changePasswordActivity
.findViewById(R.id.new_password_confirm_wrapper);
currentPassword = (EditText) changePasswordActivity
currentPassword = changePasswordActivity
.findViewById(R.id.current_password_entry);
newPassword = (EditText) changePasswordActivity
newPassword = changePasswordActivity
.findViewById(R.id.new_password_entry);
newPasswordConfirmation = (EditText) changePasswordActivity
newPasswordConfirmation = changePasswordActivity
.findViewById(R.id.new_password_confirm);
strengthMeter = (StrengthMeter) changePasswordActivity
strengthMeter = changePasswordActivity
.findViewById(R.id.strength_meter);
changePasswordButton = (Button) changePasswordActivity
changePasswordButton = changePasswordActivity
.findViewById(R.id.change_password);
}

View File

@@ -48,12 +48,12 @@ public class PasswordFragmentTest {
startFragment(passwordFragment, SetupActivity.class);
View v = passwordFragment.getView();
passwordEntry = (EditText) v.findViewById(R.id.password_entry);
passwordConfirmation = (EditText) v.findViewById(R.id.password_confirm);
passwordEntry = v.findViewById(R.id.password_entry);
passwordConfirmation = v.findViewById(R.id.password_confirm);
passwordConfirmationWrapper =
(TextInputLayout) v.findViewById(R.id.password_confirm_wrapper);
strengthMeter = (StrengthMeter) v.findViewById(R.id.strength_meter);
createAccountButton = (Button) v.findViewById(R.id.next);
v.findViewById(R.id.password_confirm_wrapper);
strengthMeter = v.findViewById(R.id.strength_meter);
createAccountButton = v.findViewById(R.id.next);
}
@Test

View File

@@ -45,10 +45,9 @@ public class SetupActivityTest {
public void setUp() {
MockitoAnnotations.initMocks(this);
setupActivity = Robolectric.setupActivity(SetupActivity.class);
nicknameEntryWrapper = (TextInputLayout) setupActivity
.findViewById(R.id.nickname_entry_wrapper);
nicknameEntry =
(EditText) setupActivity.findViewById(R.id.nickname_entry);
nicknameEntryWrapper =
setupActivity.findViewById(R.id.nickname_entry_wrapper);
nicknameEntry = setupActivity.findViewById(R.id.nickname_entry);
}
@Test