Files
brave-core/android/features/tab_ui/java/res
Artem Samoilenko 4d7af65e5c [Android] New dialogs for empty states
There are new dialogs that are shown when there are no items to show
(eg. no tabs to show, no history, no downdoaded items etc.). Design team
provided new icons for those dialogs.

Chromium changes:
https://github.com/brave/chromium/commit/29065911522b05a09c397504c8ca4f932c6a77af

Reland "[Empty States] Add empty state illustrations to tab switcher UI"
This is a reland of commit e108b3c

- Previously we rely solely on mModel to determine whether tab switcher is in empty state, however, mModel gets reset to null every time in a postHidingCleanup and thus caused the empty view to show up unexpectedly after ~30s of closing tab switcher. To address this issue, we used a     boolean mIsTabSwitcherShowing in TabListEmptyCoordinator. We set the boolean to true from TabListCoordinator.prepareTabSwitcherView() and set it to false from TabListCoordinator.postHiding. That way, we would know whether the mModel signal is from the actual tab switcher usage or from a cleanup.

Phone demo: https://drive.google.com/file/d/15tmY9gKVocYcUSzC40CCOkuiLX3KoCra/view?usp=sharing

Tablet demo:
https://drive.google.com/file/d/15vT6d-lRE8b2p3XJIhZawb7mmTKTeq9J/view?usp=sharing

Bug: 1431589, 1431588

Original change's description:
> [Empty States] Add empty state illustrations to tab switcher UI
>
> - Add TabListEmptyCoordinator class to initialize empty state resources and use ListObserver to observe mModel to decide when to add /remove empty view.
>     - Add empty view when user close a tab and tab count drops to 0.
>     - Remove empty state view when user add tab
>
> - Apply phone_tab_switcher_empty_state_illustration.xml to icon image view when form factor is phone.
> - Apply tablet_tab_switcher_empty_state_illustration.xml to icon image view when form factor is tablet.
>
> Phone demo: https://drive.google.com/file/d/17deVSRomQUQ1wj5Ml04FTM3tJ0ZXXKZo/view?usp=sharing
> Tablet demo: https://drive.google.com/file/d/1012QQcwxmBoqx7TUjOun7BlO6z2sP4o6/view?usp=sharing
>
> Change-Id: I43b89866ae612a05912b0256790cd538b38417f5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4531843
> Reviewed-by: Theresa Sullivan <twellington@chromium.org>
> Commit-Queue: Theresa Sullivan <twellington@chromium.org>
> Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1147331}

Change-Id: I0126b9a34bca7f0194b2f08c39495c19020cb618

https://github.com/brave/chromium/commit/8128eb6222ea1d237fc2ac0393e40c8ac2de4f1c

[Empty States] Add empty state illustration to Download page
- Add empty state vector drawable and layout.
  - Added downloads_empty_state_illustration.xml
  - Added downloads_empty_state_view.xml (switch to this new layout when FF is enabled)

- Use GM3 Material colors for empty state icon.
  - Since we currently can only use GM3 tokens to get Material dynamic colors in v31 or above, we have to define some not pre-existing GM3 baseline colors with values in color_palette.xml for pre-v31.
  - GM3 Material dynamic colors defined in (need google3 MaterialComponent dependency):  components/browser_ui/styles/android/java/res/values-v31/colors.xml
  - GM3 Material baseline colors defined in: ui/android/java/res/values/color_palette.xml

- Add Download empty state text strings
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_EMPTY_STATE
  - IDS_DOWNLOAD_MANAGER_NO_DOWNLOADS_VIEW_OFFLINE_OR_SHARE

Tablet demo:
https://drive.google.com/file/d/1MAtvIlV5sw5U9-zSBmhvfZerqt8jpXfr/view?usp=sharing
Phone demo:
https://drive.google.com/file/d/11TchlrDojWS1XKr6pHtw5ihH_cKdXnT8/view?usp=sharing

Spec: https://www.figma.com/file/wuV3Cx7zhj5O9Hydi7Qxaz/clank-empty-states?node-id=0-1&t=XSFbBmuUjClfkrkH-0

Bug: 1431575

https://github.com/brave/chromium/commit/35223bcab6b70ebf9d01a92715fa3d63965d98d5

[Empty States] Add empty state illustration to History page
- Add empty state vector drawable and layout.
  - Added history_empty_state_illustration.xml
  - Added history_empty_state_view.xml

- In HistoryManager.java, call #mSelectableListLayout.initializeEmptyStateView when Empty State FF is enabled.

- Use ViewStub as Empty State view holder in SelectableListLayout.xml and inflate layout in SelectableListLayout.java when Empty State FF is enabled.

- Add History empty state text strings
  - IDS_HISTORY_MANAGER_EMPTY_STATE
  - IDS_HISTORY_MANAGER_EMPTY_STATE_VIEW_OR_CLEAR_PAGE_VISITED

Phone Demo: https://drive.google.com/file/d/13FUM_x9ooStyZfo6gi4ZtniQdf2Sv4oD/view?usp=sharing
Tablet Demo: https://drive.google.com/file/d/1M8kyncAFdbkY-uCXeoQZlphIOd11zf8a/view?usp=sharing

Bug: 1431575

https://github.com/brave/chromium/commit/f45eef2ccb48048ce510318e17804c9f3155a9e4

[Empty States] Add empty state illustration to Bookmark & Reading lis…
…t pages

- Add bookmark_empty_state_illustration.xml & reading_list_empty_state_illustration.xml
- Initialize Empty State view in BookmarkManagerCoordinator
- Set string and image resources in BookmarkManagerMediator depending  on if we are in bookmark or reading list folder

Phone demo: https://drive.google.com/file/d/11CBTJz4g9mI-X27C8chmdKFJg6WMgwMQ/view?usp=sharing
Tablet demo: https://drive.google.com/file/d/12-8oYox0g806mB3TFJqpzps4u1mMNLl7/view?usp=sharing

Bug: 1431572, 1431580
2023-09-06 12:38:48 +01:00
..