Skip to content

Commit 13061c7

Browse files
committed
[CreatePasswordActivity] Resolved Password Strength Estimation Glitch
Corrected a flaw in `CreatePasswordActivity` where password strength wasn't always calculated for automatically inserted passwords until the user altered the input. This fix ensures reliable and immediate strength assessment for all entered passwords, enhancing security feedback for users.
1 parent 7656f17 commit 13061c7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

app/src/main/java/de/davis/passwordmanager/ui/elements/password/CreatePasswordActivity.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ public class CreatePasswordActivity extends CreateSecureElementActivity {
2828
protected void onCreate(@Nullable Bundle savedInstanceState) {
2929
super.onCreate(savedInstanceState);
3030

31-
Objects.requireNonNull(binding.textInputLayoutPassword.getEditText()).addTextChangedListener(binding.strengthBar);
32-
33-
binding.textInputLayoutPassword.getEditText().addTextChangedListener(binding.strengthBar);
34-
3531
ActivityResultManager activityResultManager = ActivityResultManager.getOrCreateManager(getClass(), this);
3632
activityResultManager.registerGeneratePassword(result -> binding.textInputLayoutPassword.getEditText().setText(result));
3733
binding.generate.setOnClickListener(v -> activityResultManager.launchGeneratePassword(this));
@@ -42,6 +38,7 @@ public View getContentView(@NonNull LayoutInflater inflater, @Nullable ViewGroup
4238
if(binding == null)
4339
binding = ActivityCreatePasswordBinding.inflate(inflater, container, false);
4440

41+
binding.textInputLayoutPassword.getEditText().addTextChangedListener(binding.strengthBar);
4542
return binding.getRoot();
4643
}
4744

0 commit comments

Comments
 (0)