Add icon for manual autofill selection

This commit is contained in:
Ulrich Dürholz
2021-08-28 12:48:03 +02:00
parent 39b817bc69
commit c71ef24052
2 changed files with 8 additions and 5 deletions

View File

@@ -317,11 +317,14 @@ object AutofillHelper {
webScheme = parseResult.webScheme
manualSelection = true
}
val manualSelectionView = newRemoteViews(context, database, context.getString(R.string.autofill_manual_selection_prompt), null)
val manualSelectionView = RemoteViews(context.packageName, R.layout.item_autofill_entry)
manualSelectionView.setTextViewText(R.id.autofill_entry_text, context.getString(R.string.autofill_manual_selection_prompt))
manualSelectionView.setImageViewResource(R.id.autofill_entry_icon, R.mipmap.ic_launcher_round)
val intentSender = AutofillLauncherActivity.getAuthIntentSenderForSelection(context,
searchInfo, null)
searchInfo, inlineSuggestionsRequest)
val builder = Dataset.Builder(manualSelectionView)
// enable manual selection only for the form field that has focus
parseResult.focusedId?.let { autofillId ->
builder.setValue(autofillId, AutofillValue.forText("dummy"))

View File

@@ -23,8 +23,8 @@
<ImageView
android:id="@+id/autofill_entry_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center"
android:layout_marginRight="12dp"
android:layout_marginEnd="12dp"