Merge pull request #370 from maximbaz/maximbaz-patch-1

Show account name only if it's set
This commit is contained in:
Alexander Bakker 2020-04-25 14:18:31 +02:00 committed by GitHub
commit 592d482a9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,11 +113,13 @@ public class EntryHolder extends RecyclerView.ViewHolder {
// only show the button if this entry is of type HotpInfo // only show the button if this entry is of type HotpInfo
_buttonRefresh.setVisibility(entry.getInfo() instanceof HotpInfo ? View.VISIBLE : View.GONE); _buttonRefresh.setVisibility(entry.getInfo() instanceof HotpInfo ? View.VISIBLE : View.GONE);
_profileIssuer.setText(entry.getIssuer()); String profileIssuer = entry.getIssuer();
_profileName.setText(""); String profileName = showAccountName ? entry.getName() : "";
if (showAccountName) { if (!profileIssuer.isEmpty() && !profileName.isEmpty()) {
_profileName.setText(" - " + entry.getName()); profileName = " - " + profileName;
} }
_profileIssuer.setText(profileIssuer);
_profileName.setText(profileName);
if (_hidden) { if (_hidden) {
hideCode(); hideCode();