diff options
| author | Chao Zhang <chaoz@codeaurora.org> | 2016-01-28 10:57:39 +0800 |
|---|---|---|
| committer | Chao Zhang <chaoz@codeaurora.org> | 2016-01-28 13:35:54 +0800 |
| commit | 51320ede0da9b85ae36c263b173c44343a1ed0a1 (patch) | |
| tree | 50393e5257c5618acc70c14731c2e24aee8812f1 /src | |
| parent | 49c47e4973650cdabf096c8ecb5ea483a5407c19 (diff) | |
| download | android_packages_apps_Gallery2-51320ede0da9b85ae36c263b173c44343a1ed0a1.tar.gz android_packages_apps_Gallery2-51320ede0da9b85ae36c263b173c44343a1ed0a1.tar.bz2 android_packages_apps_Gallery2-51320ede0da9b85ae36c263b173c44343a1ed0a1.zip | |
Gallery2: fix timeline title become smaller after rotate screen.
onSlotSizeChanged() will be called after rotate screen, but all images and
timelint titles won't be updated if slot width has not changed,
so timeline title size become smaller.
Update timeline title in onSlotSizeChanged(),
make sure timeline title's size is correct.
Change-Id: I2064638f308bc11a019f6cb63678ce5e016a0c8f
CRs-Fixed: 966414
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/ui/TimeLineSlidingWindow.java | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/ui/TimeLineSlidingWindow.java b/src/com/android/gallery3d/ui/TimeLineSlidingWindow.java index 0c44d46f3..6fdd34935 100644 --- a/src/com/android/gallery3d/ui/TimeLineSlidingWindow.java +++ b/src/com/android/gallery3d/ui/TimeLineSlidingWindow.java @@ -278,6 +278,22 @@ public class TimeLineSlidingWindow implements TimeLineDataLoader.DataListener { mData[slotIndex % mData.length] = entry; } + private void updateAllTimelineTitleContent(boolean needRequest) { + for (int slotIndex = mContentStart, n = mContentEnd; slotIndex < n; ++slotIndex) { + AlbumEntry entry = mData[slotIndex % mData.length]; + if (entry == null) { + continue; + } + if (entry.mediaType == MediaItem.MEDIA_TYPE_TIMELINE_TITLE) { + freeSlotContent(slotIndex); + prepareSlotContent(slotIndex); + if (needRequest) { + requestSlotImage(slotIndex); + } + } + } + } + private void updateAllImageRequests() { mActiveRequestCount = 0; for (int i = mActiveStart, n = mActiveEnd; i < n; ++i) { @@ -385,21 +401,15 @@ public class TimeLineSlidingWindow implements TimeLineDataLoader.DataListener { } public void onSlotSizeChanged(int width, int height) { - if (mSlotWidth == width) return; + if (mSlotWidth == width) { + updateAllTimelineTitleContent(true); + return; + } mSlotWidth = width; if (!mIsActive) return; - for (int slotIndex = mContentStart, n = mContentEnd; slotIndex < n; ++slotIndex) { - AlbumEntry entry = mData[slotIndex % mData.length]; - if (entry == null) { - continue; - } - if (entry.mediaType == MediaItem.MEDIA_TYPE_TIMELINE_TITLE) { - freeSlotContent(slotIndex); - prepareSlotContent(slotIndex); - } - } + updateAllTimelineTitleContent(false); updateAllImageRequests(); updateTextureUploadQueue(); } |
