diff options
| author | Selim Cinek <cinek@google.com> | 2016-04-05 17:03:40 -0700 |
|---|---|---|
| committer | Selim Cinek <cinek@google.com> | 2016-04-06 12:18:31 -0700 |
| commit | 0f9dd1e2f5561c57a2a233a42749dbfe12a5dc44 (patch) | |
| tree | b34654a7c8b0021c419d427aba3dbe939b2749c9 /core/java/android/view/NotificationHeaderView.java | |
| parent | a424c504d585fa948ec0bacb692af1e2260fc9cf (diff) | |
Deprecated the contentinfo and the number
It was mainly adding noise to the notification
rather than useful information.
Bug: 27431551
Change-Id: Ie22c9935d60eeac1cca5d9ce97239aadfac9b3cf
Diffstat (limited to 'core/java/android/view/NotificationHeaderView.java')
| -rw-r--r-- | core/java/android/view/NotificationHeaderView.java | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index cff9d8e93c98..37da8695a1ad 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -22,7 +22,6 @@ import android.graphics.Rect; import android.util.AttributeSet; import android.widget.ImageView; import android.widget.RemoteViews; -import android.widget.TextView; import java.util.ArrayList; @@ -37,7 +36,7 @@ public class NotificationHeaderView extends ViewGroup { private final int mChildMinWidth; private final int mContentEndMargin; private View mAppName; - private View mSubTextView; + private View mHeaderText; private OnClickListener mExpandClickListener; private HeaderTouchListener mTouchListener = new HeaderTouchListener(); private ImageView mExpandButton; @@ -73,11 +72,10 @@ public class NotificationHeaderView extends ViewGroup { protected void onFinishInflate() { super.onFinishInflate(); mAppName = findViewById(com.android.internal.R.id.app_name_text); - mSubTextView = findViewById(com.android.internal.R.id.header_sub_text); + mHeaderText = findViewById(com.android.internal.R.id.header_text); mExpandButton = (ImageView) findViewById(com.android.internal.R.id.expand_button); mIcon = findViewById(com.android.internal.R.id.icon); mProfileBadge = findViewById(com.android.internal.R.id.profile_badge); - mInfo = findViewById(com.android.internal.R.id.header_content_info); } @Override @@ -105,15 +103,7 @@ public class NotificationHeaderView extends ViewGroup { } if (totalWidth > givenWidth) { int overFlow = totalWidth - givenWidth; - // We are overflowing, lets shrink the info first - final int infoWidth = mInfo.getMeasuredWidth(); - if (mInfo.getVisibility() != GONE && infoWidth > mChildMinWidth) { - int newSize = infoWidth - Math.min(infoWidth - mChildMinWidth, overFlow); - int childWidthSpec = MeasureSpec.makeMeasureSpec(newSize, MeasureSpec.AT_MOST); - mInfo.measure(childWidthSpec, wrapContentHeightSpec); - overFlow -= infoWidth - newSize; - } - // still overflowing, lets shrink the app name now + // We are overflowing, lets shrink the app name first final int appWidth = mAppName.getMeasuredWidth(); if (overFlow > 0 && mAppName.getVisibility() != GONE && appWidth > mChildMinWidth) { int newSize = appWidth - Math.min(appWidth - mChildMinWidth, overFlow); @@ -121,13 +111,13 @@ public class NotificationHeaderView extends ViewGroup { mAppName.measure(childWidthSpec, wrapContentHeightSpec); overFlow -= appWidth - newSize; } - // still overflowing, finaly we shrink the subtext - if (overFlow > 0 && mSubTextView.getVisibility() != GONE) { + // still overflowing, finaly we shrink the header text + if (overFlow > 0 && mHeaderText.getVisibility() != GONE) { // we're still too big - final int subTextWidth = mSubTextView.getMeasuredWidth(); - int newSize = Math.max(0, subTextWidth - overFlow); + final int textWidth = mHeaderText.getMeasuredWidth(); + int newSize = Math.max(0, textWidth - overFlow); int childWidthSpec = MeasureSpec.makeMeasureSpec(newSize, MeasureSpec.AT_MOST); - mSubTextView.measure(childWidthSpec, wrapContentHeightSpec); + mHeaderText.measure(childWidthSpec, wrapContentHeightSpec); } } setMeasuredDimension(givenWidth, givenHeight); |
