summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn Han <lynhan@google.com> 2020-11-13 18:56:49 -0800
committer Lyn Han <lynhan@google.com> 2020-11-18 06:24:20 -0800
commit3ff7884df3b04418a2266969ea5bd2a1a280facd (patch)
treee207366453a559dadf22a6a179855057f13351f9
parent6544279fb378c77f16e75fabd554c52e34769731 (diff)
Adapt margin for actionless notifs with snooze button
Bug: 171817112 Test: visual Expanded hun/shade/ls notif bottom margin looks good - with and without snooze button - with and without actions Change-Id: Ifbd57fcf699c431a51c0713ef54126e72d648614
-rw-r--r--core/java/android/app/Notification.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4c08e759f3cf..9f85979035e0 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -67,6 +67,7 @@ import android.os.Parcelable;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.UserHandle;
+import android.provider.Settings;
import android.text.BidiFormatter;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
@@ -5371,8 +5372,11 @@ public class Notification implements Parcelable
big.setViewVisibility(R.id.notification_material_reply_text_3, View.GONE);
big.setTextViewText(R.id.notification_material_reply_text_3, null);
+ final boolean snoozeEnabled = mContext.getContentResolver() != null
+ && (Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.SHOW_NOTIFICATION_SNOOZE, 0) == 1);
big.setViewLayoutMarginBottomDimen(R.id.notification_action_list_margin_target,
- R.dimen.notification_content_margin);
+ snoozeEnabled ? 0 : R.dimen.notification_content_margin);
}
private RemoteViews applyStandardTemplateWithActions(int layoutId,