From: Marco Nelissen Date: Wed, 6 Feb 2013 23:35:52 +0000 (-0800) Subject: Don't call requestLayout from onLayout X-Git-Tag: android-x86-7.1-r1~458^2~673^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=fae20fe4b7ffb8cce73f93c6f20ee62487f6e46c;p=android-x86%2Fpackages-apps-Gallery2.git Don't call requestLayout from onLayout Doing a layout within a layout can lead to various problems, so it should be avoided. There's some logging that warns of this, which got triggered by CommonControllerOverlay. I don't know what problem this code was originally trying to solve, but it doesn't seem to be necessary anymore. The line in question was originally introduced in change 209a9163d4e8cee0bfe162ae598ef40e6051479c, in Oct 2011. Change-Id: I1402a842df59df31b69ad981337ea1c8630103df --- diff --git a/src/com/android/gallery3d/app/CommonControllerOverlay.java b/src/com/android/gallery3d/app/CommonControllerOverlay.java index 089872fa5..a5aa805ef 100644 --- a/src/com/android/gallery3d/app/CommonControllerOverlay.java +++ b/src/com/android/gallery3d/app/CommonControllerOverlay.java @@ -274,10 +274,6 @@ public abstract class CommonControllerOverlay extends FrameLayout implements mBackground.layout(0, y - mTimeBar.getBarHeight(), w, y); mTimeBar.layout(pl, y - mTimeBar.getPreferredHeight(), w - pr, y); - // Needed, otherwise the framework will not re-layout in case only the - // padding is changed - mTimeBar.requestLayout(); - // Put the play/pause/next/ previous button in the center of the screen layoutCenteredView(mPlayPauseReplayView, 0, 0, w, h);