Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +0 −14 Original line number Diff line number Diff line Loading @@ -178,20 +178,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } /** * Set alpha directly to mView will clip clock, so we set alpha to clock face instead */ public void setAlpha(float alpha) { ClockController clock = getClock(); if (clock != null) { clock.getLargeClock().getView().setAlpha(alpha); clock.getSmallClock().getView().setAlpha(alpha); } if (mStatusArea != null) { mStatusArea.setAlpha(alpha); } } /** * Attach the controller to the view it relates to. */ Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +0 −25 Original line number Diff line number Diff line Loading @@ -135,29 +135,4 @@ public class KeyguardStatusView extends GridLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); Trace.endSection(); } /** * Clock content will be clipped when goes beyond bounds, * so we setAlpha for all views except clock */ public void setAlpha(float alpha, boolean excludeClock) { if (!excludeClock) { setAlpha(alpha); return; } for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child == mStatusViewContainer) { for (int j = 0; j < mStatusViewContainer.getChildCount(); j++) { View innerChild = mStatusViewContainer.getChildAt(j); if (innerChild != mClockView) { innerChild.setAlpha(alpha); } } } else { child.setAlpha(alpha); } } } } packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +1 −2 Original line number Diff line number Diff line Loading @@ -180,8 +180,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV */ public void setAlpha(float alpha) { if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) { mView.setAlpha(alpha, true); mKeyguardClockSwitchController.setAlpha(alpha); mView.setAlpha(alpha); } } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −12 Original line number Diff line number Diff line Loading @@ -134,7 +134,6 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { private KeyguardClockSwitchController mController; private View mSliceView; private LinearLayout mStatusArea; private FakeExecutor mExecutor; @Before Loading Loading @@ -196,8 +195,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { mSliceView = new View(getContext()); when(mView.findViewById(R.id.keyguard_slice_view)).thenReturn(mSliceView); mStatusArea = new LinearLayout(getContext()); when(mView.findViewById(R.id.keyguard_status_area)).thenReturn(mStatusArea); when(mView.findViewById(R.id.keyguard_status_area)).thenReturn( new LinearLayout(getContext())); } @Test Loading Loading @@ -402,15 +401,6 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { assertNull(mController.getClock()); } @Test public void testSetAlpha_setClockAlphaForCLockFace() { mController.onViewAttached(); mController.setAlpha(0.5f); verify(mLargeClockView).setAlpha(0.5f); verify(mSmallClockView).setAlpha(0.5f); assertEquals(0.5f, mStatusArea.getAlpha(), 0.0f); } private void verifyAttachment(VerificationMode times) { verify(mClockRegistry, times).registerClockChangeListener( any(ClockRegistry.ClockChangeListener.class)); Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -24,8 +24,6 @@ class KeyguardStatusViewTest : SysuiTestCase() { get() = keyguardStatusView.findViewById(R.id.status_view_media_container) private val statusViewContainer: ViewGroup get() = keyguardStatusView.findViewById(R.id.status_view_container) private val clockView: ViewGroup get() = keyguardStatusView.findViewById(R.id.keyguard_clock_container) private val childrenExcludingMedia get() = statusViewContainer.children.filter { it != mediaView } Loading Loading @@ -58,12 +56,4 @@ class KeyguardStatusViewTest : SysuiTestCase() { assertThat(it.translationY).isEqualTo(translationY) } } @Test fun setAlphaExcludeClock() { keyguardStatusView.setAlpha(0.5f, /* excludeClock= */true) assertThat(statusViewContainer.alpha).isNotEqualTo(0.5f) assertThat(mediaView.alpha).isEqualTo(0.5f) assertThat(clockView.alpha).isNotEqualTo(0.5f) } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +0 −14 Original line number Diff line number Diff line Loading @@ -178,20 +178,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS } } /** * Set alpha directly to mView will clip clock, so we set alpha to clock face instead */ public void setAlpha(float alpha) { ClockController clock = getClock(); if (clock != null) { clock.getLargeClock().getView().setAlpha(alpha); clock.getSmallClock().getView().setAlpha(alpha); } if (mStatusArea != null) { mStatusArea.setAlpha(alpha); } } /** * Attach the controller to the view it relates to. */ Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +0 −25 Original line number Diff line number Diff line Loading @@ -135,29 +135,4 @@ public class KeyguardStatusView extends GridLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); Trace.endSection(); } /** * Clock content will be clipped when goes beyond bounds, * so we setAlpha for all views except clock */ public void setAlpha(float alpha, boolean excludeClock) { if (!excludeClock) { setAlpha(alpha); return; } for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (child == mStatusViewContainer) { for (int j = 0; j < mStatusViewContainer.getChildCount(); j++) { View innerChild = mStatusViewContainer.getChildAt(j); if (innerChild != mClockView) { innerChild.setAlpha(alpha); } } } else { child.setAlpha(alpha); } } } }
packages/SystemUI/src/com/android/keyguard/KeyguardStatusViewController.java +1 −2 Original line number Diff line number Diff line Loading @@ -180,8 +180,7 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV */ public void setAlpha(float alpha) { if (!mKeyguardVisibilityHelper.isVisibilityAnimating()) { mView.setAlpha(alpha, true); mKeyguardClockSwitchController.setAlpha(alpha); mView.setAlpha(alpha); } } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +2 −12 Original line number Diff line number Diff line Loading @@ -134,7 +134,6 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { private KeyguardClockSwitchController mController; private View mSliceView; private LinearLayout mStatusArea; private FakeExecutor mExecutor; @Before Loading Loading @@ -196,8 +195,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { mSliceView = new View(getContext()); when(mView.findViewById(R.id.keyguard_slice_view)).thenReturn(mSliceView); mStatusArea = new LinearLayout(getContext()); when(mView.findViewById(R.id.keyguard_status_area)).thenReturn(mStatusArea); when(mView.findViewById(R.id.keyguard_status_area)).thenReturn( new LinearLayout(getContext())); } @Test Loading Loading @@ -402,15 +401,6 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { assertNull(mController.getClock()); } @Test public void testSetAlpha_setClockAlphaForCLockFace() { mController.onViewAttached(); mController.setAlpha(0.5f); verify(mLargeClockView).setAlpha(0.5f); verify(mSmallClockView).setAlpha(0.5f); assertEquals(0.5f, mStatusArea.getAlpha(), 0.0f); } private void verifyAttachment(VerificationMode times) { verify(mClockRegistry, times).registerClockChangeListener( any(ClockRegistry.ClockChangeListener.class)); Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardStatusViewTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -24,8 +24,6 @@ class KeyguardStatusViewTest : SysuiTestCase() { get() = keyguardStatusView.findViewById(R.id.status_view_media_container) private val statusViewContainer: ViewGroup get() = keyguardStatusView.findViewById(R.id.status_view_container) private val clockView: ViewGroup get() = keyguardStatusView.findViewById(R.id.keyguard_clock_container) private val childrenExcludingMedia get() = statusViewContainer.children.filter { it != mediaView } Loading Loading @@ -58,12 +56,4 @@ class KeyguardStatusViewTest : SysuiTestCase() { assertThat(it.translationY).isEqualTo(translationY) } } @Test fun setAlphaExcludeClock() { keyguardStatusView.setAlpha(0.5f, /* excludeClock= */true) assertThat(statusViewContainer.alpha).isNotEqualTo(0.5f) assertThat(mediaView.alpha).isEqualTo(0.5f) assertThat(clockView.alpha).isNotEqualTo(0.5f) } }