Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +3 −11 Original line number Diff line number Diff line Loading @@ -209,7 +209,6 @@ public class KeyguardClockSwitch extends RelativeLayout { if (!animate) { out.setAlpha(0f); out.setVisibility(INVISIBLE); in.setAlpha(1f); in.setVisibility(VISIBLE); mStatusArea.setTranslationY(statusAreaYTranslation); Loading @@ -225,11 +224,8 @@ public class KeyguardClockSwitch extends RelativeLayout { direction * -mClockSwitchYAmount)); mClockOutAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mClockOutAnim == animation) { out.setVisibility(INVISIBLE); mClockOutAnim = null; } } }); in.setAlpha(0); Loading @@ -242,10 +238,8 @@ public class KeyguardClockSwitch extends RelativeLayout { mClockInAnim.setStartDelay(CLOCK_OUT_MILLIS / 2); mClockInAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mClockInAnim == animation) { mClockInAnim = null; } } }); mClockInAnim.start(); Loading @@ -257,10 +251,8 @@ public class KeyguardClockSwitch extends RelativeLayout { mStatusAreaAnim.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); mStatusAreaAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mStatusAreaAnim == animation) { mStatusAreaAnim = null; } } }); mStatusAreaAnim.start(); } Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +8 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS int clockHeight = clock.getLargeClock().getView().getHeight(); return frameHeight / 2 + clockHeight / 2 + mKeyguardLargeClockTopMargin / -2; } else { // This is only called if we've never shown the large clock as the frame is inflated // with 'gone', but then the visibility is never set when it is animated away by // KeyguardClockSwitch, instead it is removed from the view hierarchy. // TODO(b/261755021): Cleanup Large Frame Visibility int clockHeight = clock.getSmallClock().getView().getHeight(); return clockHeight + statusBarHeaderHeight + mKeyguardSmallClockTopMargin; } Loading @@ -421,11 +425,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS if (mLargeClockFrame.getVisibility() == View.VISIBLE) { return clock.getLargeClock().getView().getHeight(); } else { // Is not called except in certain edge cases, see comment in getClockBottom // TODO(b/261755021): Cleanup Large Frame Visibility return clock.getSmallClock().getView().getHeight(); } } boolean isClockTopAligned() { // Returns false except certain edge cases, see comment in getClockBottom // TODO(b/261755021): Cleanup Large Frame Visibility return mLargeClockFrame.getVisibility() != View.VISIBLE; } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.keyguard; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static com.android.keyguard.KeyguardClockSwitch.LARGE; Loading Loading @@ -190,7 +189,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { assertThat(mLargeClockFrame.getAlpha()).isEqualTo(1); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(VISIBLE); assertThat(mSmallClockFrame.getAlpha()).isEqualTo(0); assertThat(mSmallClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -200,7 +198,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { assertThat(mLargeClockFrame.getAlpha()).isEqualTo(1); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(VISIBLE); assertThat(mSmallClockFrame.getAlpha()).isEqualTo(0); assertThat(mSmallClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -215,7 +212,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { // only big clock is removed at switch assertThat(mLargeClockFrame.getParent()).isNull(); assertThat(mLargeClockFrame.getAlpha()).isEqualTo(0); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -227,7 +223,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { // only big clock is removed at switch assertThat(mLargeClockFrame.getParent()).isNull(); assertThat(mLargeClockFrame.getAlpha()).isEqualTo(0); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java +3 −11 Original line number Diff line number Diff line Loading @@ -209,7 +209,6 @@ public class KeyguardClockSwitch extends RelativeLayout { if (!animate) { out.setAlpha(0f); out.setVisibility(INVISIBLE); in.setAlpha(1f); in.setVisibility(VISIBLE); mStatusArea.setTranslationY(statusAreaYTranslation); Loading @@ -225,11 +224,8 @@ public class KeyguardClockSwitch extends RelativeLayout { direction * -mClockSwitchYAmount)); mClockOutAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mClockOutAnim == animation) { out.setVisibility(INVISIBLE); mClockOutAnim = null; } } }); in.setAlpha(0); Loading @@ -242,10 +238,8 @@ public class KeyguardClockSwitch extends RelativeLayout { mClockInAnim.setStartDelay(CLOCK_OUT_MILLIS / 2); mClockInAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mClockInAnim == animation) { mClockInAnim = null; } } }); mClockInAnim.start(); Loading @@ -257,10 +251,8 @@ public class KeyguardClockSwitch extends RelativeLayout { mStatusAreaAnim.setInterpolator(Interpolators.FAST_OUT_SLOW_IN); mStatusAreaAnim.addListener(new AnimatorListenerAdapter() { public void onAnimationEnd(Animator animation) { if (mStatusAreaAnim == animation) { mStatusAreaAnim = null; } } }); mStatusAreaAnim.start(); } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +8 −0 Original line number Diff line number Diff line Loading @@ -404,6 +404,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS int clockHeight = clock.getLargeClock().getView().getHeight(); return frameHeight / 2 + clockHeight / 2 + mKeyguardLargeClockTopMargin / -2; } else { // This is only called if we've never shown the large clock as the frame is inflated // with 'gone', but then the visibility is never set when it is animated away by // KeyguardClockSwitch, instead it is removed from the view hierarchy. // TODO(b/261755021): Cleanup Large Frame Visibility int clockHeight = clock.getSmallClock().getView().getHeight(); return clockHeight + statusBarHeaderHeight + mKeyguardSmallClockTopMargin; } Loading @@ -421,11 +425,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS if (mLargeClockFrame.getVisibility() == View.VISIBLE) { return clock.getLargeClock().getView().getHeight(); } else { // Is not called except in certain edge cases, see comment in getClockBottom // TODO(b/261755021): Cleanup Large Frame Visibility return clock.getSmallClock().getView().getHeight(); } } boolean isClockTopAligned() { // Returns false except certain edge cases, see comment in getClockBottom // TODO(b/261755021): Cleanup Large Frame Visibility return mLargeClockFrame.getVisibility() != View.VISIBLE; } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java +0 −5 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.keyguard; import static android.view.View.INVISIBLE; import static android.view.View.VISIBLE; import static com.android.keyguard.KeyguardClockSwitch.LARGE; Loading Loading @@ -190,7 +189,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { assertThat(mLargeClockFrame.getAlpha()).isEqualTo(1); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(VISIBLE); assertThat(mSmallClockFrame.getAlpha()).isEqualTo(0); assertThat(mSmallClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -200,7 +198,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { assertThat(mLargeClockFrame.getAlpha()).isEqualTo(1); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(VISIBLE); assertThat(mSmallClockFrame.getAlpha()).isEqualTo(0); assertThat(mSmallClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -215,7 +212,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { // only big clock is removed at switch assertThat(mLargeClockFrame.getParent()).isNull(); assertThat(mLargeClockFrame.getAlpha()).isEqualTo(0); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading @@ -227,7 +223,6 @@ public class KeyguardClockSwitchTest extends SysuiTestCase { // only big clock is removed at switch assertThat(mLargeClockFrame.getParent()).isNull(); assertThat(mLargeClockFrame.getAlpha()).isEqualTo(0); assertThat(mLargeClockFrame.getVisibility()).isEqualTo(INVISIBLE); } @Test Loading