Show account name only if it's set

This commit is contained in:
Maxim Baz 2020-04-19 00:05:29 +02:00 committed by Maxim Baz
parent abe78370ea
commit ad05e375f1
No known key found for this signature in database
GPG key ID: 011FDC52DA839335

View file

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