Merge "Centering big clock vertically on large screen lockscreen and AOD" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-12-10 20:23:01 +00:00
committed by Android (Google) Code Review

View File

@@ -89,7 +89,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final KeyguardBypassController mBypassController; private final KeyguardBypassController mBypassController;
private int mLargeClockTopMargin = 0;
private int mKeyguardClockTopMargin = 0; private int mKeyguardClockTopMargin = 0;
/** /**
@@ -276,16 +275,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
} }
private void updateClockLayout() { private void updateClockLayout() {
int largeClockTopMargin = 0;
if (mSmartspaceController.isEnabled()) { if (mSmartspaceController.isEnabled()) {
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, largeClockTopMargin = getContext().getResources().getDimensionPixelSize(
MATCH_PARENT);
mLargeClockTopMargin = getContext().getResources().getDimensionPixelSize(
R.dimen.keyguard_large_clock_top_margin); R.dimen.keyguard_large_clock_top_margin);
lp.topMargin = mLargeClockTopMargin;
mLargeClockFrame.setLayoutParams(lp);
} else {
mLargeClockTopMargin = 0;
} }
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT,
MATCH_PARENT);
lp.topMargin = largeClockTopMargin;
mLargeClockFrame.setLayoutParams(lp);
} }
/** /**