| commit | 677a65d143ddf42de7bcab28100421bf5bbcd593 | [log] [tgz] |
|---|---|---|
| author | Joshua Trask <joshtrask@google.com> | Thu Oct 05 19:43:40 2023 +0000 |
| committer | Joshua Trask <joshtrask@google.com> | Thu Oct 05 20:50:41 2023 +0000 |
| tree | 2f2ff8567f3de38149177cadb57a0c05e85d404e | |
| parent | c2f1d0cc70ef6083fd47e055a421fd74f620ea33 [diff] |
`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
IntentResolver provides the implementation for Intent ACTION_CHOOSER
See also: ShareCompat.IntentBuilder