mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Solve protected field display
This commit is contained in:
@@ -304,10 +304,10 @@ public class EntryActivity extends LockingHideActivity {
|
||||
|
||||
MenuItem togglePassword = menu.findItem(R.id.menu_toggle_pass);
|
||||
if (entryContentsView != null && togglePassword != null) {
|
||||
if (!entryContentsView.isPasswordPresent()) {
|
||||
togglePassword.setVisible(false);
|
||||
} else {
|
||||
if (entryContentsView.isPasswordPresent() || entryContentsView.atLeastOneFieldProtectedPresent()) {
|
||||
changeShowPasswordIcon(togglePassword);
|
||||
} else {
|
||||
togglePassword.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,6 +146,15 @@ public class EntryContentsView extends LinearLayout {
|
||||
return passwordContainerView.getVisibility() == VISIBLE;
|
||||
}
|
||||
|
||||
public boolean atLeastOneFieldProtectedPresent() {
|
||||
for (int i = 0; i < extrasView.getChildCount(); i++) {
|
||||
View childCustomView = extrasView.getChildAt(i);
|
||||
if (childCustomView instanceof EntryCustomFieldProtected)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setHiddenPasswordStyle(boolean hiddenStyle) {
|
||||
if ( !hiddenStyle ) {
|
||||
passwordView.setTransformationMethod(null);
|
||||
|
||||
Reference in New Issue
Block a user