File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
policy/src/com/android/internal/policy/impl/keyguard Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,11 @@ public void onScrollStateChanged(int scrollState) {
214214 mKeyguardWidgetPager .setWidgetToResetOnPageFadeOut (mPageListeningToSlider );
215215 }
216216 }
217+ if (frame .isSmall ()) {
218+ // This is to make sure that if the scroller animation gets cut off midway
219+ // that the frame doesn't stay in a partial down position.
220+ frame .setFrameHeight (frame .getSmallFrameHeight ());
221+ }
217222 if (scrollState != SlidingChallengeLayout .SCROLL_STATE_FADING ) {
218223 frame .hideFrame (this );
219224 }
@@ -244,7 +249,7 @@ public void onScrollStateChanged(int scrollState) {
244249 if (!frame .isSmall ()) {
245250 // We need to fetch the final page, in case the pages are in motion.
246251 mPageListeningToSlider = mKeyguardWidgetPager .getNextPage ();
247- frame .shrinkWidget ();
252+ frame .shrinkWidget (false );
248253 }
249254 } else {
250255 if (!frame .isSmall ()) {
@@ -263,7 +268,7 @@ public void onScrollStateChanged(int scrollState) {
263268 public void onScrollPositionChanged (float scrollPosition , int challengeTop ) {
264269 mChallengeTop = challengeTop ;
265270 KeyguardWidgetFrame frame = mKeyguardWidgetPager .getWidgetPageAt (mPageListeningToSlider );
266- if (frame != null && ! mKeyguardWidgetPager . isPageMoving () ) {
271+ if (frame != null && mLastScrollState != SlidingChallengeLayout . SCROLL_STATE_FADING ) {
267272 frame .adjustFrame (getChallengeTopRelativeToFrame (frame , mChallengeTop ));
268273 }
269274 }
Original file line number Diff line number Diff line change @@ -329,6 +329,7 @@ private void setWidgetHeight(int height) {
329329
330330 public void setMaxChallengeTop (int top ) {
331331 boolean dirty = mMaxChallengeTop != top ;
332+ mMaxChallengeTop = top ;
332333 mSmallWidgetHeight = top - getPaddingTop ();
333334 mSmallFrameHeight = top + getPaddingBottom ();
334335 if (dirty && mIsSmall ) {
@@ -348,10 +349,21 @@ public void adjustFrame(int challengeTop) {
348349 setFrameHeight (frameHeight );
349350 }
350351
351- public void shrinkWidget () {
352+ public void shrinkWidget (boolean alsoShrinkFrame ) {
352353 mIsSmall = true ;
353354 setWidgetHeight (mSmallWidgetHeight );
354- setFrameHeight (mSmallFrameHeight );
355+
356+ if (alsoShrinkFrame ) {
357+ setFrameHeight (mSmallFrameHeight );
358+ }
359+ }
360+
361+ public int getSmallFrameHeight () {
362+ return mSmallFrameHeight ;
363+ }
364+
365+ public void shrinkWidget () {
366+ shrinkWidget (true );
355367 }
356368
357369 public void setWidgetLockedSmall (boolean locked ) {
You can’t perform that action at this time.
0 commit comments