Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d8aa4d6 authored by Joy Babafemi's avatar Joy Babafemi
Browse files

Credman- Update dropdown presentation logic according to UX updates

Removes ***** from dropdown password entry and do not display username
in subtitle if display name is equal to username

Bug:319126175
Change-Id: Icaada753b8c85c6b7edcdb72cc96668d6d460548
parent 9b2e54f2
Loading
Loading
Loading
Loading
+51 −55
Original line number Original line Diff line number Diff line
@@ -45,21 +45,17 @@ class RemoteViewsFactory {
                return remoteViews
                return remoteViews
            }
            }
            setRemoteViewsPaddings(remoteViews, context, /* primaryTextBottomPadding=*/0)
            setRemoteViewsPaddings(remoteViews, context, /* primaryTextBottomPadding=*/0)
            if (credentialEntryInfo.credentialType == CredentialType.PASSKEY) {
            val displayName = credentialEntryInfo.displayName ?: credentialEntryInfo.userName
            val displayName = credentialEntryInfo.displayName ?: credentialEntryInfo.userName
            remoteViews.setTextViewText(android.R.id.text1, displayName)
            remoteViews.setTextViewText(android.R.id.text1, displayName)
                val secondaryText = if (credentialEntryInfo.displayName != null)
            val secondaryText =
                if (credentialEntryInfo.displayName != null
                    && (credentialEntryInfo.displayName != credentialEntryInfo.userName))
                    (credentialEntryInfo.userName + " " + bulletPoint + " "
                    (credentialEntryInfo.userName + " " + bulletPoint + " "
                            + credentialEntryInfo.credentialTypeDisplayName
                            + credentialEntryInfo.credentialTypeDisplayName
                            + " " + bulletPoint + " " + credentialEntryInfo.providerDisplayName)
                            + " " + bulletPoint + " " + credentialEntryInfo.providerDisplayName)
                else (credentialEntryInfo.credentialTypeDisplayName + " " + bulletPoint + " "
                else (credentialEntryInfo.credentialTypeDisplayName + " " + bulletPoint + " "
                        + credentialEntryInfo.providerDisplayName)
                        + credentialEntryInfo.providerDisplayName)
            remoteViews.setTextViewText(android.R.id.text2, secondaryText)
            remoteViews.setTextViewText(android.R.id.text2, secondaryText)
            } else {
                remoteViews.setTextViewText(android.R.id.text1, credentialEntryInfo.userName)
                remoteViews.setTextViewText(android.R.id.text2,
                        bulletPoint.repeat(passwordCharacterLength))
            }
            val textColorPrimary = ContextCompat.getColor(context,
            val textColorPrimary = ContextCompat.getColor(context,
                com.android.credentialmanager.R.color.text_primary)
                com.android.credentialmanager.R.color.text_primary)
            remoteViews.setTextColor(android.R.id.text1, textColorPrimary)
            remoteViews.setTextColor(android.R.id.text1, textColorPrimary)