[PR #2616] [PM-2320] Improve Android block Auto-fill URIs #3683

Closed
opened 2025-11-26 23:36:05 -06:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/2616

State: closed
Merged: Yes


Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Improve current way to block Auto-fill URIs. This is an Android feature.

Code changes

  • BlockAutofillUrisPage.xaml: New view to display blocked autofill URIs.
    • BlockAutofillUrisPage.xaml.cs: New view to display blocked autofill URIs. Added this as theme dirtable to change the placeholder corresponding to the current app theme.
  • BlockAutofillUrisPageViewModel.cs: New view model to handle the logic for blocked autofill URIs and also validation on input.
  • OptionsPage.xaml: Changed UI to be simpler and just navigate to the new view
  • OptionsPage.xaml.cs: Removed old blocked Uris logic
  • OptionsPageViewModel.cs: Removed old blocked Uris logic and added navigation to new view
  • DeviceActionService.cs: Added new DisplayValidatablePromptAsync(...) method that shows a custom alert dialog with a custom view that has validations and execute the validations when pressing save. The dialog is dismissed on save only when all validations are valid. Also, added a few improvements for accessibility.
  • validatable_input_dialog_layout.xml: Custom dialog view to display input that can be validated
  • dimens.xml: Custom dimensions for validatable_input_dialog_layout.xml
  • CustomLabel.cs: Added ability to change the font weight
  • CustomLabelRenderer.cs: Added ability to change the font weight on API 28+
  • ValidatablePromptConfig.cs: Config parameters for DeviceActionService.DisplayValidatablePromptAsync. Chose struct over method parameters to have more flexibility and because they are a lot.
  • empty_uris_placeholder.xml: New icon to be displayed when there are no Uris in the list
  • empty_uris_placeholder_dark.xml: New icon to be displayed when there are no Uris in the list on dark themes (transparent fill color)

Screenshots

Options Block autofill light

Options Block autofill light

Options Block autofill dark

Options Block autofill dark

Block autofill empty light

Block autofill empty light

Block autofill empty dark

Block autofill empty dark

Block autofill multiple items light

Block autofill multiple items light

Block autofill multiple items dark

Block autofill multiple items dark

Block autofill new uri

Block autofill new uri

Block autofill new uri error

Block autofill new uri error

Block Autofill edit uri

Block Autofill edit uri

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team
**Original Pull Request:** https://github.com/bitwarden/android/pull/2616 **State:** closed **Merged:** Yes --- ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Improve current way to block Auto-fill URIs. This is an Android feature. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **BlockAutofillUrisPage.xaml:** New view to display blocked autofill URIs. * * **BlockAutofillUrisPage.xaml.cs:** New view to display blocked autofill URIs. Added this as theme dirtable to change the placeholder corresponding to the current app theme. * **BlockAutofillUrisPageViewModel.cs:** New view model to handle the logic for blocked autofill URIs and also validation on input. * **OptionsPage.xaml:** Changed UI to be simpler and just navigate to the new view * **OptionsPage.xaml.cs:** Removed old blocked Uris logic * **OptionsPageViewModel.cs:** Removed old blocked Uris logic and added navigation to new view * **DeviceActionService.cs:** Added new `DisplayValidatablePromptAsync(...)` method that shows a custom alert dialog with a custom view that has validations and execute the validations when pressing `save`. The dialog is dismissed on `save` only when all validations are valid. Also, added a few improvements for accessibility. * **validatable_input_dialog_layout.xml:** Custom dialog view to display input that can be validated * **dimens.xml:** Custom dimensions for `validatable_input_dialog_layout.xml` * **CustomLabel.cs:** Added ability to change the font weight * **CustomLabelRenderer.cs:** Added ability to change the font weight on API 28+ * **ValidatablePromptConfig.cs:** Config parameters for `DeviceActionService.DisplayValidatablePromptAsync`. Chose struct over method parameters to have more flexibility and because they are a lot. * **empty_uris_placeholder.xml:** New icon to be displayed when there are no Uris in the list * **empty_uris_placeholder_dark.xml:** New icon to be displayed when there are no Uris in the list on dark themes (transparent fill color) ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ### Options Block autofill light <img width="314" alt="Options Block autofill light" src="https://github.com/bitwarden/mobile/assets/15682323/0da929c3-cf22-467f-80a1-06be59779353"> ### Options Block autofill dark <img width="314" alt="Options Block autofill dark" src="https://github.com/bitwarden/mobile/assets/15682323/4ca32460-4323-4239-b360-f1ef3ffaf397"> ### Block autofill empty light <img width="314" alt="Block autofill empty light" src="https://github.com/bitwarden/mobile/assets/15682323/95dacda8-6b57-4ed1-9ee1-c84d5584eefe"> ### Block autofill empty dark <img width="314" alt="Block autofill empty dark" src="https://github.com/bitwarden/mobile/assets/15682323/e1cf5fef-25b5-4976-bb39-bca850b92b3c"> ### Block autofill multiple items light <img width="314" alt="Block autofill multiple items light" src="https://github.com/bitwarden/mobile/assets/15682323/9f8bce05-950c-4848-a455-04a64d77690e"> ### Block autofill multiple items dark <img width="314" alt="Block autofill multiple items dark" src="https://github.com/bitwarden/mobile/assets/15682323/c99cbc0c-e101-4959-8484-af87fa724dd9"> ### Block autofill new uri <img width="314" alt="Block autofill new uri" src="https://github.com/bitwarden/mobile/assets/15682323/7c5f3123-833d-483d-a3c6-08b364e78e55"> ### Block autofill new uri error <img width="314" alt="Block autofill new uri error" src="https://github.com/bitwarden/mobile/assets/15682323/d8a1a07d-28b3-43b4-a8be-0a3753a577f9"> ### Block Autofill edit uri <img width="314" alt="Block Autofill edit uri" src="https://github.com/bitwarden/mobile/assets/15682323/c917ad8b-b7ce-46b5-85f4-310595699308"> ## Before you submit - Please check for formatting errors (`dotnet format --verify-no-changes`) (required) - Please add **unit tests** where it makes sense to do so (encouraged but not required) - If this change requires a **documentation update** - notify the documentation team - If this change has particular **deployment requirements** - notify the DevOps team
GiteaMirror added the pull-request label 2025-11-26 23:36:05 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3683