Merge "Do not hide the header of a HUN." into sc-dev am: 4a312a8afb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14456997 Change-Id: Id1f9ff2152d3bbf441dca79f84251e4fd53d3f88
This commit is contained in:
@@ -148,6 +148,9 @@
|
|||||||
<!-- Minimum display time for a heads up notification, in milliseconds. -->
|
<!-- Minimum display time for a heads up notification, in milliseconds. -->
|
||||||
<integer name="heads_up_notification_minimum_time">2000</integer>
|
<integer name="heads_up_notification_minimum_time">2000</integer>
|
||||||
|
|
||||||
|
<!-- Whether to hide the notification header when the HUN is expanded. -->
|
||||||
|
<bool name="heads_up_notification_hides_header">false</bool>
|
||||||
|
|
||||||
<!-- The number of milliseconds before the heads up notification accepts touches. -->
|
<!-- The number of milliseconds before the heads up notification accepts touches. -->
|
||||||
<integer name="touch_acceptance_delay">700</integer>
|
<integer name="touch_acceptance_delay">700</integer>
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import com.android.systemui.statusbar.notification.row.HybridNotificationView;
|
|||||||
public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapper {
|
public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapper {
|
||||||
|
|
||||||
private final int mFullHeaderTranslation;
|
private final int mFullHeaderTranslation;
|
||||||
|
private final boolean mAllowHideHeader;
|
||||||
protected ImageView mRightIcon;
|
protected ImageView mRightIcon;
|
||||||
protected ImageView mLeftIcon;
|
protected ImageView mLeftIcon;
|
||||||
private ProgressBar mProgressBar;
|
private ProgressBar mProgressBar;
|
||||||
@@ -71,6 +72,7 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
|
|||||||
protected NotificationTemplateViewWrapper(Context ctx, View view,
|
protected NotificationTemplateViewWrapper(Context ctx, View view,
|
||||||
ExpandableNotificationRow row) {
|
ExpandableNotificationRow row) {
|
||||||
super(ctx, view, row);
|
super(ctx, view, row);
|
||||||
|
mAllowHideHeader = ctx.getResources().getBoolean(R.bool.heads_up_notification_hides_header);
|
||||||
mTransformationHelper.setCustomTransformation(
|
mTransformationHelper.setCustomTransformation(
|
||||||
new ViewTransformationHelper.CustomTransformation() {
|
new ViewTransformationHelper.CustomTransformation() {
|
||||||
@Override
|
@Override
|
||||||
@@ -249,7 +251,7 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
|
|||||||
super.onContentUpdated(row);
|
super.onContentUpdated(row);
|
||||||
// With the modern templates, a large icon visually overlaps the header, so we can't
|
// With the modern templates, a large icon visually overlaps the header, so we can't
|
||||||
// hide the header, we must show it.
|
// hide the header, we must show it.
|
||||||
mCanHideHeader = mNotificationHeader != null
|
mCanHideHeader = mAllowHideHeader && mNotificationHeader != null
|
||||||
&& (mRightIcon == null || mRightIcon.getVisibility() != VISIBLE);
|
&& (mRightIcon == null || mRightIcon.getVisibility() != VISIBLE);
|
||||||
if (row.getHeaderVisibleAmount() != DEFAULT_HEADER_VISIBLE_AMOUNT) {
|
if (row.getHeaderVisibleAmount() != DEFAULT_HEADER_VISIBLE_AMOUNT) {
|
||||||
setHeaderVisibleAmount(row.getHeaderVisibleAmount());
|
setHeaderVisibleAmount(row.getHeaderVisibleAmount());
|
||||||
|
|||||||
Reference in New Issue
Block a user