Skip to content

Commit

Permalink
Autofill suggestion: hide second line if subtitle empty (#5670)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1149059203486286/1209453476472064

### Description
Hide subtitle when string is empty, making suggestion a single line.

### Steps to test this PR

_Feature 1_
- [ ] from an api 29 device o no keyboard
- [ ] select ddg as autofill provider
- [ ] visit fill.dev on another browser
- [ ] focus a field to get suggestions
- [ ] they should show as dropdown
- [ ] ensure entry point to DDG is single line

### UI changes
| Before  | After |
| ------ | ----- |
!(Upload before screenshot)|(Upload after screenshot)|
  • Loading branch information
cmonfortep authored Feb 24, 2025
1 parent 6e0de0c commit c581dca
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import android.app.slice.Slice
import android.content.Context
import android.graphics.drawable.Icon
import android.service.autofill.InlinePresentation
import android.view.View
import android.widget.RemoteViews
import android.widget.inline.InlinePresentationSpec
import androidx.annotation.DrawableRes
Expand Down Expand Up @@ -138,5 +139,9 @@ class RealAutofillServiceViewProvider @Inject constructor(
R.id.ddgIcon,
iconRes,
)
setViewVisibility(
R.id.subtitle,
if (subtitle.isEmpty()) View.GONE else View.VISIBLE,
)
}
}

0 comments on commit c581dca

Please sign in to comment.