Fix vertical height of emphasized action buttons
Fixes: 279636135 Test: visually inspect CallStyle and FSI notifications at various font sizes Change-Id: If9a83e86563bf8e5a23df3a9fa0a1f64a520cfb1
This commit is contained in:
@@ -50,6 +50,8 @@ public class NotificationActionListLayout extends LinearLayout {
|
||||
private boolean mEmphasizedMode;
|
||||
private int mDefaultPaddingBottom;
|
||||
private int mDefaultPaddingTop;
|
||||
private int mEmphasizedPaddingTop;
|
||||
private int mEmphasizedPaddingBottom;
|
||||
private int mEmphasizedHeight;
|
||||
private int mRegularHeight;
|
||||
@DimenRes private int mCollapsibleIndentDimen = R.dimen.notification_actions_padding_start;
|
||||
@@ -322,13 +324,16 @@ public class NotificationActionListLayout extends LinearLayout {
|
||||
}
|
||||
|
||||
private void updateHeights() {
|
||||
int paddingTop = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin);
|
||||
int inset = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.button_inset_vertical_material);
|
||||
mEmphasizedPaddingTop = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin) - inset;
|
||||
// same padding on bottom and at end
|
||||
int paddingBottom = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin_end);
|
||||
mEmphasizedHeight = paddingBottom + paddingTop + getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_action_emphasized_height);
|
||||
mEmphasizedPaddingBottom = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin_end) - inset;
|
||||
mEmphasizedHeight = mEmphasizedPaddingTop + mEmphasizedPaddingBottom
|
||||
+ getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_action_emphasized_height);
|
||||
mRegularHeight = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_action_list_height);
|
||||
}
|
||||
@@ -356,18 +361,10 @@ public class NotificationActionListLayout extends LinearLayout {
|
||||
mEmphasizedMode = emphasizedMode;
|
||||
int height;
|
||||
if (emphasizedMode) {
|
||||
int paddingTop = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin);
|
||||
// same padding on bottom and at end
|
||||
int paddingBottom = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin_end);
|
||||
int buttonPaddingInternal = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.button_inset_vertical_material);
|
||||
setPaddingRelative(getPaddingStart(),
|
||||
paddingTop - buttonPaddingInternal,
|
||||
mEmphasizedPaddingTop,
|
||||
getPaddingEnd(),
|
||||
paddingBottom - buttonPaddingInternal);
|
||||
|
||||
mEmphasizedPaddingBottom);
|
||||
setMinimumHeight(mEmphasizedHeight);
|
||||
height = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
} else {
|
||||
|
||||
@@ -257,8 +257,8 @@
|
||||
<!-- The margin of the notification action list at the top -->
|
||||
<dimen name="notification_action_list_margin_top">0dp</dimen>
|
||||
|
||||
<!-- The visual height of the emphasized notification action -->
|
||||
<dimen name="notification_action_emphasized_height">36dp</dimen>
|
||||
<!-- The overall height of the emphasized notification action -->
|
||||
<dimen name="notification_action_emphasized_height">48dp</dimen>
|
||||
|
||||
<!-- The padding of the actions in non-conversation layout. For conversations, the analogous
|
||||
value is calculated in ConversationLayout#updateActionListPadding() -->
|
||||
|
||||
Reference in New Issue
Block a user