`showEmptyState()` -> EmptyStateUiHelper

As part of ongoing work to pull low-level empty state responsibilities
out of the pager adapter, this CL generally replicates the change
prototyped in ag/24516421/5..7, in smaller incremental steps to "show
the work." As originally described in that CL:

  "... moves most of the low-level logic of `showEmptyState()` into
the UI helper. (...) also has the UI helper take responsibility for
setting the visibility of the main "list view" in sync (opposite of)
the empty state visibility."

As presented in this CL, the "incremental steps" per-snapshot are:

 1. Extract most of the implementation directly to the new method at
    `EmptyStateUiHelper.showEmptyState()`. The general functionality
    is covered by existing integration tests (e.g., commenting-out the
    new method body causes `UnbundledChooserActivityWorkProfileTest`
    to fail). New `EmptyStateUiHelper` unit tests cover finer points
    of the empty-state "button" conditions, and I've added a TODO
    comment at one place legacy behavior seemingly may not align with
    the original developer intent.

 2. Also make the UI helper responsible for propagating empty-state
    visibility changes back to the main list view (hiding the main
    list when we show an empty state, and restoring it when the empty
    state is hidden).

 3. Look up all the sub-views during `EmptyStateUiHelper` construction
    so we don't have to keep repeating their View IDs throughout.

 4. Tighten visibility on `EmptyStateUiHelper.resetViewVisibilities()`
    now that it's a private `showEmptyState()` implementation detail
    (updated to package-protected/visible-for-testing). Also move the
    method to the end of the class (after all the public methods).

Bug: 302311217
Test: IntentResolverUnitTests
Change-Id: Iac0cf3d62e2c3bf22afa6a2796ae4e731b706c02
3 files changed
tree: 2f2ff8567f3de38149177cadb57a0c05e85d404e
  1. aconfig/
  2. java/
  3. .clang-format
  4. Android.bp
  5. AndroidManifest-app.xml
  6. AndroidManifest-lib.xml
  7. OWNERS
  8. PREUPLOAD.cfg
  9. proguard.flags
  10. README.md
  11. TEST_MAPPING
README.md

IntentResolver

About

IntentResolver provides the implementation for Intent ACTION_CHOOSER

See also: ShareCompat.IntentBuilder