Fix flash caused by frame resize code

This fixes a problem where the frame would resize mid-animation because
the widget frame was being always being resized.

The issue was caused by having an extra fadeOutChallenge() in
onPageSwitching().   The fix is to remove this and handle this case
special for warping in onPageEndWarp()

Fixes bug 11190745

Change-Id: I6dbda4d09c77e3923887f8d41efb2215e1afb1b9
This commit is contained in:
Jim Miller
2013-10-28 19:08:42 -07:00
parent 371427b53c
commit 6b0afaddae
5 changed files with 10 additions and 17 deletions

View File

@@ -39,7 +39,7 @@ public interface ChallengeLayout {
*
* @param b true to show, false to hide
*/
void showChallenge(boolean b);
void showChallenge(boolean show);
/**
* Show the bouncer challenge. This may block access to other child views.

View File

@@ -120,21 +120,19 @@ public class KeyguardViewStateManager implements
public void fadeOutSecurity(int duration) {
((View) mKeyguardSecurityContainer).animate().alpha(0f).setDuration(duration)
.setListener(mPauseListener).start();
.setListener(mPauseListener);
}
public void fadeInSecurity(int duration) {
((View) mKeyguardSecurityContainer).animate().alpha(1f).setDuration(duration)
.setListener(mResumeListener).start();
.setListener(mResumeListener);
}
public void onPageBeginMoving() {
if (mChallengeLayout.isChallengeOverlapping() &&
mChallengeLayout instanceof SlidingChallengeLayout) {
SlidingChallengeLayout scl = (SlidingChallengeLayout) mChallengeLayout;
if (!mKeyguardWidgetPager.isWarping()) {
scl.fadeOutChallenge();
}
scl.fadeOutChallenge();
mPageIndexOnPageBeginMoving = mKeyguardWidgetPager.getCurrentPage();
}
// We use mAppWidgetToShow to show a particular widget after you add it--
@@ -158,9 +156,6 @@ public class KeyguardViewStateManager implements
boolean isCameraPage = newPage instanceof CameraWidgetFrame;
SlidingChallengeLayout scl = (SlidingChallengeLayout) mChallengeLayout;
scl.setChallengeInteractive(!isCameraPage);
if (isCameraPage) {
scl.fadeOutChallenge();
}
final int currentFlags = mKeyguardWidgetPager.getSystemUiVisibility();
final int newFlags = isCameraPage ? (currentFlags | View.STATUS_BAR_DISABLE_SEARCH)
: (currentFlags & ~View.STATUS_BAR_DISABLE_SEARCH);
@@ -197,7 +192,7 @@ public class KeyguardViewStateManager implements
boolean challengeOverlapping = mChallengeLayout.isChallengeOverlapping();
if (challengeOverlapping && !newCurPage.isSmall()
&& mPageListeningToSlider != newPageIndex) {
newCurPage.shrinkWidget();
newCurPage.shrinkWidget(true);
}
}

View File

@@ -375,10 +375,6 @@ public class KeyguardWidgetFrame extends FrameLayout {
return mSmallFrameHeight;
}
public void shrinkWidget() {
shrinkWidget(true);
}
public void setWidgetLockedSmall(boolean locked) {
if (locked) {
setWidgetHeight(mSmallWidgetHeight);

View File

@@ -194,7 +194,9 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
@Override
public void onPageEndWarp() {
hideOutlinesAndSidePages();
// if we're moving to the warp page, then immediately hide the other widgets.
int duration = getPageWarpIndex() == getNextPage() ? 0 : -1;
animateOutlinesAndSidePages(false, duration);
mViewStateManager.onPageEndWarp();
}
@@ -669,7 +671,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
// On the very first measure pass, if the challenge is showing, we need to make sure
// that the widget on the current page is small.
if (challengeShowing && i == mCurrentPage && !mHasMeasure) {
frame.shrinkWidget();
frame.shrinkWidget(true);
}
}
}

View File

@@ -2725,7 +2725,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
};
private void cancelWarpAnimation(String msg, boolean abortAnimation) {
if (DEBUG_WARP) Log.v(TAG, "cancelWarpAnimation(" + msg + ")");
if (DEBUG_WARP) Log.v(TAG, "cancelWarpAnimation(" + msg + ",abort=" + abortAnimation + ")");
if (abortAnimation) {
// We're done with the animation and moving to a new page. Let the scroller
// take over the animation.