summaryrefslogtreecommitdiff
path: root/java/src-debug
diff options
context:
space:
mode:
author Andrey Epin <ayepin@google.com> 2023-08-11 10:45:36 -0700
committer Andrey Epin <ayepin@google.com> 2023-08-17 21:24:58 -0700
commitea59592a728c2fb00070f15873e85939b806a3d9 (patch)
tree9fd811c70b55087cf2fb13a4463673eee54746b9 /java/src-debug
parentec63bbe163af26cf64e8b122dfb923d1a70a62f7 (diff)
Load preivews eagerly
Currently, content preview is not started until the metadata for all the shared URIs is loaded. This CL changes it to eagerly loaded previews i.e. previews are getting loaded as soon as the corresponding metadata becomes available. This is achieved by: * Adding support for a Flow as a preview source into ScrollableImgePreviewView (patchset #1); Specifically, as a Flow may never complete, the flow collection is cancelled in `onDetachFromWindow` to avoid possible memory leaks. The view is used inside a RecyclerView (the single-profile case) and can be attached and detached multiple times per one `setPreviews` call. Thus BatchPreviewLoader is made relaunchable and captures a notion of a pending loading job; `#batchLoader` value gets updated accordingly. (patchset #8) * Make PreviewDataProvider expose a Flow of shared URIs metadata, FileInfo (patchset #2, #3); * Make content preview classes to pass the Flow from PreviewDataProvider to ScrollableImagePreviewView (patchset #4). Bug: 292157413 Test: manual testing with ShareTest app: with and without artificial image loading delays, orientation changes and on single- and multi-profile cases. Test: unit tests Test: integration test Change-Id: Ib663bab8917624493a9ba619e64e4cb81fa35a93
Diffstat (limited to 'java/src-debug')
0 files changed, 0 insertions, 0 deletions