Loading packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +7 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mSmartspaceView.registerDataProvider(plugin); View asView = (View) mSmartspaceView; // Place plugin view below normal clock... RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( MATCH_PARENT, WRAP_CONTENT); lp.addRule(RelativeLayout.BELOW, R.id.lockscreen_clock_view); Loading @@ -197,6 +198,11 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS .getDimensionPixelSize(R.dimen.below_clock_padding_start); asView.setPadding(padding, 0, padding, 0); // ... but above the large clock lp = new RelativeLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT); lp.addRule(RelativeLayout.BELOW, asView.getId()); mLargeClockFrame.setLayoutParams(lp); View nic = mView.findViewById( com.android.systemui.R.id.left_aligned_notification_icon_container); lp = (RelativeLayout.LayoutParams) nic.getLayoutParams(); Loading @@ -219,6 +225,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS nic.getLayoutParams(); lp.addRule(RelativeLayout.BELOW, R.id.keyguard_status_area); nic.setLayoutParams(lp); mLargeClockFrame.setLayoutParams(lp); mSmartspaceView = null; } Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import android.widget.RelativeLayout; import com.android.internal.colorextraction.ColorExtractor; Loading Loading @@ -98,6 +99,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { @Mock private AnimatableClockView mLargeClockView; @Mock private FrameLayout mLargeClockFrame; @Mock BatteryController mBatteryController; private KeyguardClockSwitchController mController; Loading @@ -112,6 +115,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { when(mView.findViewById(R.id.animatable_clock_view)).thenReturn(mClockView); when(mView.findViewById(R.id.animatable_clock_view_large)).thenReturn(mLargeClockView); when(mView.findViewById(R.id.lockscreen_clock_view_large)).thenReturn(mLargeClockFrame); when(mClockView.getContext()).thenReturn(getContext()); when(mLargeClockView.getContext()).thenReturn(getContext()); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java +7 −0 Original line number Diff line number Diff line Loading @@ -188,6 +188,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS mSmartspaceView.registerDataProvider(plugin); View asView = (View) mSmartspaceView; // Place plugin view below normal clock... RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams( MATCH_PARENT, WRAP_CONTENT); lp.addRule(RelativeLayout.BELOW, R.id.lockscreen_clock_view); Loading @@ -197,6 +198,11 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS .getDimensionPixelSize(R.dimen.below_clock_padding_start); asView.setPadding(padding, 0, padding, 0); // ... but above the large clock lp = new RelativeLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT); lp.addRule(RelativeLayout.BELOW, asView.getId()); mLargeClockFrame.setLayoutParams(lp); View nic = mView.findViewById( com.android.systemui.R.id.left_aligned_notification_icon_container); lp = (RelativeLayout.LayoutParams) nic.getLayoutParams(); Loading @@ -219,6 +225,7 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS nic.getLayoutParams(); lp.addRule(RelativeLayout.BELOW, R.id.keyguard_status_area); nic.setLayoutParams(lp); mLargeClockFrame.setLayoutParams(lp); mSmartspaceView = null; } Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchControllerTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.test.suitebuilder.annotation.SmallTest; import android.testing.AndroidTestingRunner; import android.util.AttributeSet; import android.view.View; import android.widget.FrameLayout; import android.widget.RelativeLayout; import com.android.internal.colorextraction.ColorExtractor; Loading Loading @@ -98,6 +99,8 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { @Mock private AnimatableClockView mLargeClockView; @Mock private FrameLayout mLargeClockFrame; @Mock BatteryController mBatteryController; private KeyguardClockSwitchController mController; Loading @@ -112,6 +115,7 @@ public class KeyguardClockSwitchControllerTest extends SysuiTestCase { when(mView.findViewById(R.id.animatable_clock_view)).thenReturn(mClockView); when(mView.findViewById(R.id.animatable_clock_view_large)).thenReturn(mLargeClockView); when(mView.findViewById(R.id.lockscreen_clock_view_large)).thenReturn(mLargeClockFrame); when(mClockView.getContext()).thenReturn(getContext()); when(mLargeClockView.getContext()).thenReturn(getContext()); Loading