Centering big clock vertically on large screen lockscreen and AOD
Big clock was not centered vertically properly in case we don't support smartspace on the device. When smartspace is not present big clock's height is wrap_content and that makes it (and all parent views) takes much less space. Then even though clock might be centered in parent, parent is not centered on the screen so it doesn't change much. This change is making it always go match_parent, that is (more or less) full height of the screen. Fixes: 209013448 Test: manual Change-Id: I721b5750ae34d204c6eb0bdb7edca6aa12e3a88b
This commit is contained in:
@@ -89,7 +89,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||
private final KeyguardBypassController mBypassController;
|
||||
|
||||
private int mLargeClockTopMargin = 0;
|
||||
private int mKeyguardClockTopMargin = 0;
|
||||
|
||||
/**
|
||||
@@ -276,16 +275,15 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
||||
}
|
||||
|
||||
private void updateClockLayout() {
|
||||
int largeClockTopMargin = 0;
|
||||
if (mSmartspaceController.isEnabled()) {
|
||||
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT,
|
||||
MATCH_PARENT);
|
||||
mLargeClockTopMargin = getContext().getResources().getDimensionPixelSize(
|
||||
largeClockTopMargin = getContext().getResources().getDimensionPixelSize(
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user