OSDN Git Service

Revert "Increased the text size for colorized notifications"
authorSelim Cinek <cinek@google.com>
Wed, 20 Sep 2017 22:52:29 +0000 (22:52 +0000)
committerSelim Cinek <cinek@google.com>
Wed, 20 Sep 2017 23:03:12 +0000 (23:03 +0000)
This reverts commit 299b3302ef6ea5094f094e92f384853aa012172b.

Change-Id: Id887bd37f8f7b0c1ff48c339c9d59491f65cae84
Bug: 35925915
Fixes: 66067974

core/java/android/app/Notification.java
core/res/res/values/dimens.xml
core/res/res/values/symbols.xml
packages/SystemUI/res/values/dimens.xml
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationTemplateViewWrapper.java
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationViewWrapper.java

index 4497e0b..9511f3f 100644 (file)
@@ -67,7 +67,6 @@ import android.text.style.TextAppearanceSpan;
 import android.util.ArraySet;
 import android.util.Log;
 import android.util.SparseArray;
-import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.NotificationHeaderView;
 import android.view.View;
@@ -3899,7 +3898,6 @@ public class Notification implements Parcelable
             if (p.title != null) {
                 contentView.setViewVisibility(R.id.title, View.VISIBLE);
                 contentView.setTextViewText(R.id.title, processTextSpans(p.title));
-                updateTextSizePrimary(contentView, R.id.title);
                 if (!p.ambient) {
                     setTextViewColorPrimary(contentView, R.id.title);
                 }
@@ -3911,7 +3909,6 @@ public class Notification implements Parcelable
                 int textId = showProgress ? com.android.internal.R.id.text_line_1
                         : com.android.internal.R.id.text;
                 contentView.setTextViewText(textId, processTextSpans(p.text));
-                updateTextSizeSecondary(contentView, textId);
                 if (!p.ambient) {
                     setTextViewColorSecondary(contentView, textId);
                 }
@@ -3923,25 +3920,6 @@ public class Notification implements Parcelable
             return contentView;
         }
 
-        private void updateTextSizeSecondary(RemoteViews contentView, int textId) {
-            updateTextSizeColorized(contentView, textId,
-                    com.android.internal.R.dimen.notification_text_size_colorized,
-                    com.android.internal.R.dimen.notification_text_size);
-        }
-
-        private void updateTextSizePrimary(RemoteViews contentView, int textId) {
-            updateTextSizeColorized(contentView, textId,
-                    com.android.internal.R.dimen.notification_title_text_size_colorized,
-                    com.android.internal.R.dimen.notification_title_text_size);
-        }
-
-        private void updateTextSizeColorized(RemoteViews contentView, int textId,
-                int colorizedDimen, int normalDimen) {
-            int size = mContext.getResources().getDimensionPixelSize(isColorized()
-                    ? colorizedDimen : normalDimen);
-            contentView.setTextViewTextSize(textId, TypedValue.COMPLEX_UNIT_PX, size);
-        }
-
         private CharSequence processTextSpans(CharSequence text) {
             if (hasForegroundColor()) {
                 return NotificationColorUtil.clearColorSpans(text);
@@ -5867,7 +5845,6 @@ public class Notification implements Parcelable
             builder.setTextViewColorSecondary(contentView, R.id.big_text);
             contentView.setViewVisibility(R.id.big_text,
                     TextUtils.isEmpty(bigTextText) ? View.GONE : View.VISIBLE);
-            builder.updateTextSizeSecondary(contentView, R.id.big_text);
             contentView.setBoolean(R.id.big_text, "setHasImage", builder.mN.hasLargeIcon());
         }
     }
@@ -6201,7 +6178,6 @@ public class Notification implements Parcelable
                 contentView.setViewVisibility(rowId, View.VISIBLE);
                 contentView.setTextViewText(rowId, mBuilder.processTextSpans(
                         makeMessageLine(m, mBuilder)));
-                mBuilder.updateTextSizeSecondary(contentView, rowId);
                 mBuilder.setTextViewColorSecondary(contentView, rowId);
 
                 if (contractedMessage == m) {
@@ -6569,7 +6545,6 @@ public class Notification implements Parcelable
                     contentView.setViewVisibility(rowIds[i], View.VISIBLE);
                     contentView.setTextViewText(rowIds[i],
                             mBuilder.processTextSpans(mBuilder.processLegacyText(str)));
-                    mBuilder.updateTextSizeSecondary(contentView, rowIds[i]);
                     mBuilder.setTextViewColorSecondary(contentView, rowIds[i]);
                     contentView.setViewPadding(rowIds[i], 0, topPadding, 0, 0);
                     handleInboxImageMargin(contentView, rowIds[i], first);
index a835f7f..9b1ebc8 100644 (file)
     <dimen name="notification_text_size">14sp</dimen>
     <!-- Size of notification text titles (see TextAppearance.StatusBar.EventContent.Title) -->
     <dimen name="notification_title_text_size">14sp</dimen>
-
-    <!-- Size of notification text (see TextAppearance.StatusBar.EventContent) when colorized -->
-    <dimen name="notification_text_size_colorized">16sp</dimen>
-    <!-- Size of notification text titles (see TextAppearance.StatusBar.EventContent.Title) when colorized -->
-    <dimen name="notification_title_text_size_colorized">20sp</dimen>
     <!-- Size of smaller notification text (see TextAppearance.StatusBar.EventContent.Line2, Info, Time) -->
     <dimen name="notification_subtext_size">12sp</dimen>
 
index ba66011..8c10a8d 100644 (file)
   <java-symbol type="array" name="config_allowedSystemInstantAppSettings" />
   <java-symbol type="array" name="config_allowedSecureInstantAppSettings" />
 
-  <java-symbol type="dimen" name="notification_text_size_colorized" />
-  <java-symbol type="dimen" name="notification_title_text_size_colorized" />
-
   <java-symbol type="bool" name="config_handleVolumeKeysInWindowManager" />
   <java-symbol type="dimen" name="config_inCallNotificationVolume" />
   <java-symbol type="string" name="config_inCallNotificationSound" />
index a485712..bcaafcc 100644 (file)
     <!-- Height of a small notification in the status bar which was used before android N -->
     <dimen name="notification_min_height_legacy">64dp</dimen>
 
-    <!-- The increase in minHeight that is allowed when the notification is colorized -->
-    <dimen name="notification_height_increase_colorized">11sp</dimen>
-
-    <!-- The increase in minHeight that is allowed when the notification is colorized and has increased height (i.e messages) -->
-    <dimen name="notification_height_increase_colorized_increased">13sp</dimen>
-
     <!-- Height of a large notification in the status bar -->
     <dimen name="notification_max_height">284dp</dimen>
 
index b48f15c..7bc1a39 100644 (file)
@@ -64,10 +64,10 @@ import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
 import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem;
 import com.android.systemui.statusbar.NotificationGuts.GutsContent;
 import com.android.systemui.statusbar.notification.AboveShelfChangedListener;
+import com.android.systemui.statusbar.notification.AboveShelfObserver;
 import com.android.systemui.statusbar.notification.HybridNotificationView;
 import com.android.systemui.statusbar.notification.NotificationInflater;
 import com.android.systemui.statusbar.notification.NotificationUtils;
-import com.android.systemui.statusbar.notification.NotificationViewWrapper;
 import com.android.systemui.statusbar.notification.VisualStabilityManager;
 import com.android.systemui.statusbar.phone.NotificationGroupManager;
 import com.android.systemui.statusbar.phone.StatusBar;
@@ -421,9 +421,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
         } else {
             minHeight = mNotificationMinHeight;
         }
-        NotificationViewWrapper collapsedWrapper = layout.getVisibleWrapper(
-                NotificationContentView.VISIBLE_TYPE_CONTRACTED);
-        minHeight += collapsedWrapper.getMinHeightIncrease(mUseIncreasedCollapsedHeight);
         boolean headsUpCustom = layout.getHeadsUpChild() != null &&
                 layout.getHeadsUpChild().getId()
                         != com.android.internal.R.id.status_bar_latest_event_content;
@@ -435,11 +432,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
         } else {
             headsUpheight = mMaxHeadsUpHeight;
         }
-        NotificationViewWrapper headsUpWrapper = layout.getVisibleWrapper(
-                NotificationContentView.VISIBLE_TYPE_HEADSUP);
-        if (headsUpWrapper != null) {
-            headsUpheight += headsUpWrapper.getMinHeightIncrease(mUseIncreasedCollapsedHeight);
-        }
         layout.setHeights(minHeight, headsUpheight, mNotificationMaxHeight,
                 mNotificationAmbientHeight);
     }
index 9bfa7a9..bb979eb 100644 (file)
@@ -25,7 +25,6 @@ import android.widget.ImageView;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import com.android.systemui.R;
 import com.android.systemui.statusbar.CrossFadeHelper;
 import com.android.systemui.statusbar.ExpandableNotificationRow;
 import com.android.systemui.statusbar.TransformableView;
@@ -48,7 +47,6 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
 
     private int mContentHeight;
     private int mMinHeightHint;
-    private boolean mColorized;
 
     protected NotificationTemplateViewWrapper(Context ctx, View view,
             ExpandableNotificationRow row) {
@@ -164,9 +162,7 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
     public void onContentUpdated(ExpandableNotificationRow row) {
         // Reinspect the notification. Before the super call, because the super call also updates
         // the transformation types and we need to have our values set by then.
-        StatusBarNotification sbn = row.getStatusBarNotification();
-        resolveTemplateViews(sbn);
-        mColorized = sbn.getNotification().isColorized();
+        resolveTemplateViews(row.getStatusBarNotification());
         super.onContentUpdated(row);
     }
 
@@ -269,17 +265,6 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
         updateActionOffset();
     }
 
-    @Override
-    public int getMinHeightIncrease(boolean useIncreasedCollapsedHeight) {
-        if (mColorized) {
-            int dimen = useIncreasedCollapsedHeight
-                    ? R.dimen.notification_height_increase_colorized_increased
-                    : R.dimen.notification_height_increase_colorized;
-            return mRow.getResources().getDimensionPixelSize(dimen);
-        }
-        return super.getMinHeightIncrease(useIncreasedCollapsedHeight);
-    }
-
     private void updateActionOffset() {
         if (mActionsContainer != null) {
             // We should never push the actions higher than they are in the headsup view.
index 085bce9..5200d69 100644 (file)
@@ -190,14 +190,4 @@ public abstract class NotificationViewWrapper implements TransformableView {
     public boolean disallowSingleClick(float x, float y) {
         return false;
     }
-
-    /**
-     * Get the amount that the minheight is allowed to be increased based on this layout.
-     *
-     * @param increasedHeight is the view allowed to show even bigger, i.e for messaging layouts
-     * @return
-     */
-    public int getMinHeightIncrease(boolean increasedHeight) {
-        return 0;
-    }
 }