From 11687f87b52c5f8ef34e7ad83c352242f49e7a81 Mon Sep 17 00:00:00 2001 From: John Reck Date: Sun, 17 Jul 2011 13:40:31 -0700 Subject: Fix drawing order bug Bug: 5031335 Gallery could return an invalid index leading to a NPE The override for getDrawingOrder appears unnecessary for how we are using gallery, so removing it entirely Change-Id: I931cc2db6e601a00941c23585b57664607f4e519 --- src/com/android/browser/view/Gallery.java | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/com') diff --git a/src/com/android/browser/view/Gallery.java b/src/com/android/browser/view/Gallery.java index aa6ed6564..0c735373b 100644 --- a/src/com/android/browser/view/Gallery.java +++ b/src/com/android/browser/view/Gallery.java @@ -1195,24 +1195,6 @@ public class Gallery extends ViewGroup implements } } - @Override - protected int getChildDrawingOrder(int childCount, int i) { - int selectedIndex = mSelectedPosition - mFirstPosition; - // Just to be safe - if (selectedIndex < 0) - return i; - if (i == childCount - 1) { - // Draw the selected child last - return selectedIndex; - } else if (i >= selectedIndex) { - // Move the children to the right of the selected child earlier one - return i + 1; - } else { - // Keep the children to the left of the selected child the same - return i; - } - } - @Override protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) { -- cgit v1.2.3