OSDN Git Service

Update notification to allow multiline text
authorSalvador Martinez <dehboxturtle@google.com>
Tue, 3 Apr 2018 20:05:39 +0000 (13:05 -0700)
committerSalvador Martinez <dehboxturtle@google.com>
Tue, 3 Apr 2018 20:05:39 +0000 (13:05 -0700)
Sometimes the remaining time text can be a bit too long for one line.
This change updates the notification to allow the text to go onto the
second line.

Test: visual inspection
Bug: 77500880
Change-Id: I8f87383dab9b27890934ad969d0c4e8a26f3c3a3

packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java

index 49b00ce..c53ee5f 100644 (file)
@@ -229,10 +229,11 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
                         // Bump the notification when the bucket dropped.
                         .setWhen(mWarningTriggerTimeMs)
                         .setShowWhen(false)
-                        .setContentTitle(title)
                         .setContentText(contentText)
+                        .setContentTitle(title)
                         .setOnlyAlertOnce(true)
                         .setDeleteIntent(pendingBroadcast(ACTION_DISMISSED_WARNING))
+                        .setStyle(new Notification.BigTextStyle().bigText(contentText))
                         .setVisibility(Notification.VISIBILITY_PUBLIC);
         if (hasBatterySettings()) {
             nb.setContentIntent(pendingBroadcast(ACTION_SHOW_BATTERY_SETTINGS));