Merge "Fixes an issue where the padding to the clock was wrong" into qt-r1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c2abf3b9e9
@@ -41,7 +41,7 @@
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/widget_vertical_padding"
|
||||
android:layout_marginTop="24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:src="@drawable/kg_security_lock_normal" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
android:id="@+id/clock_notification_icon_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/notification_shelf_height"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginTop="@dimen/widget_vertical_padding"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</com.android.keyguard.KeyguardStatusView>
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
<dimen name="title_clock_padding">4dp</dimen>
|
||||
<!-- Clock with header -->
|
||||
<dimen name="widget_small_font_size">@dimen/widget_title_font_size</dimen>
|
||||
<dimen name="widget_vertical_padding">24dp</dimen>
|
||||
<dimen name="widget_vertical_padding_with_header">32dp</dimen>
|
||||
<dimen name="widget_vertical_padding">17dp</dimen>
|
||||
<dimen name="widget_vertical_padding_with_header">25dp</dimen>
|
||||
<dimen name="widget_vertical_padding_clock">12dp</dimen>
|
||||
<!-- Subtitle paddings -->
|
||||
<dimen name="widget_horizontal_padding">8dp</dimen>
|
||||
|
||||
@@ -73,8 +73,8 @@ public class KeyguardStatusView extends GridLayout implements
|
||||
* Bottom margin that defines the margin between bottom of smart space and top of notification
|
||||
* icons on AOD.
|
||||
*/
|
||||
private int mBottomMargin;
|
||||
private int mBottomMarginWithHeader;
|
||||
private int mIconTopMargin;
|
||||
private int mIconTopMarginWithHeader;
|
||||
private boolean mShowingHeader;
|
||||
|
||||
private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
|
||||
@@ -209,12 +209,14 @@ public class KeyguardStatusView extends GridLayout implements
|
||||
return;
|
||||
}
|
||||
mShowingHeader = hasHeader;
|
||||
// Update bottom margin since header has appeared/disappeared.
|
||||
if (mStatusViewContainer != null) {
|
||||
MarginLayoutParams params = (MarginLayoutParams) mStatusViewContainer.getLayoutParams();
|
||||
params.setMargins(params.leftMargin, params.topMargin, params.rightMargin,
|
||||
hasHeader ? mBottomMarginWithHeader : mBottomMargin);
|
||||
mStatusViewContainer.setLayoutParams(params);
|
||||
if (mNotificationIcons != null) {
|
||||
// Update top margin since header has appeared/disappeared.
|
||||
MarginLayoutParams params = (MarginLayoutParams) mNotificationIcons.getLayoutParams();
|
||||
params.setMargins(params.leftMargin,
|
||||
hasHeader ? mIconTopMarginWithHeader : mIconTopMargin,
|
||||
params.rightMargin,
|
||||
params.bottomMargin);
|
||||
mNotificationIcons.setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,8 +342,8 @@ public class KeyguardStatusView extends GridLayout implements
|
||||
}
|
||||
|
||||
private void loadBottomMargin() {
|
||||
mBottomMargin = getResources().getDimensionPixelSize(R.dimen.widget_vertical_padding);
|
||||
mBottomMarginWithHeader = getResources().getDimensionPixelSize(
|
||||
mIconTopMargin = getResources().getDimensionPixelSize(R.dimen.widget_vertical_padding);
|
||||
mIconTopMarginWithHeader = getResources().getDimensionPixelSize(
|
||||
R.dimen.widget_vertical_padding_with_header);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user