OSDN Git Service

Reduce view add/removes when loading photos
authorAlan Newberger <alann@google.com>
Thu, 22 Jan 2015 19:48:27 +0000 (11:48 -0800)
committerAlan Newberger <alann@google.com>
Thu, 22 Jan 2015 23:25:00 +0000 (15:25 -0800)
commit8e29072ca69229a25dc4a856e3635d131613f4ca
treeaa0e0b9fae1860b5cac8499e9a96c9bcd31bae68
parent93864cf39dfe25c27b41fb327d590dc31ff69fe5
Reduce view add/removes when loading photos

Two fixes to reduce flicker when loading images. First, adjust
ViewItem instances in-place instead of creating new ViewItems
which included adding and removing views from the hierarchy.
It turned out we were doing an update for every photo due to
touching PanoramaMetadata and reporting back that metadata
was adjusted, whether or not a photo was a panorama. Now
that data is reported. New photo captures are essentially
added and removed from the view hierarchy three times before
this change, after an ImageView is added once, with its
contents changed as the photo is loaded.

More testing is needed but I cannot repro the elusive filmstrip
flicker with these changes.

Bug: 18977838
Bug: 17905863
Change-Id: I5a42c0baf87a8cef0ee4dbcf9f03d40715e6aa2d
src/com/android/camera/data/MetadataLoader.java
src/com/android/camera/data/PanoramaMetadataLoader.java
src/com/android/camera/data/RgbzMetadataLoader.java
src/com/android/camera/data/VideoRotationMetadataLoader.java
src/com/android/camera/widget/FilmstripView.java