Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
Use correct strings for no username in autofill.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhugman committed Mar 11, 2019
1 parent 9214217 commit d6f76ff
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,26 @@ open class FillResponseBuilder(
val datasetBuilder = Dataset.Builder()

val title = titleFromHostname(credential.hostname)
val username = credential.username ?: context.getString(R.string.no_username)

parsedStructure.usernameId?.let {
val presentation = RemoteViews(context.packageName, R.layout.autofill_item)
.apply {
setTextViewText(R.id.autofillValue, credential.username)
setTextViewText(R.id.autofillValue, username)
setTextViewText(R.id.hostname, title)
}

datasetBuilder.setValue(
it,
AutofillValue.forText(credential.username),
AutofillValue.forText(credential.username ?: ""),
presentation
)
}

parsedStructure.passwordId?.let {
val presentation = RemoteViews(context.packageName, R.layout.autofill_item)
.apply {
setTextViewText(R.id.autofillValue, context.getString(R.string.password_for, credential.username))
setTextViewText(R.id.autofillValue, context.getString(R.string.password_for, username))
setTextViewText(R.id.hostname, title)
}

Expand Down

0 comments on commit d6f76ff

Please sign in to comment.