diff options
| author | Selim Cinek <cinek@google.com> | 2015-11-23 13:51:13 -0800 |
|---|---|---|
| committer | Selim Cinek <cinek@google.com> | 2015-11-30 17:46:21 -0800 |
| commit | eaa29ca6ff7a4c21a0729118d0e7c38750b9c93e (patch) | |
| tree | 0f8f43aaaeffe2a9f590763ad158ff51950fd67e /core/java/android/view/NotificationHeaderView.java | |
| parent | aef6c76f763f8c743ad8c47b6ce29946273f1986 (diff) | |
Migrated the systemUI based notification header
Previously the notification header had a seperate implementation
in SystemUI from which the platform implementation was derived.
Now that everything is in the framework, we’re migrating the
implementation for notification groups.ß
Change-Id: Ia61a75bd6c85e1805d4364a9e7e4587a020c1271
Diffstat (limited to 'core/java/android/view/NotificationHeaderView.java')
| -rw-r--r-- | core/java/android/view/NotificationHeaderView.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java index 46cd7aea9f63..82f6c7f8ce44 100644 --- a/core/java/android/view/NotificationHeaderView.java +++ b/core/java/android/view/NotificationHeaderView.java @@ -23,6 +23,7 @@ import android.graphics.Rect; import android.util.AttributeSet; import android.widget.LinearLayout; import android.widget.RemoteViews; +import android.widget.TextView; import java.util.ArrayList; @@ -40,6 +41,7 @@ public class NotificationHeaderView extends LinearLayout { private HeaderTouchListener mTouchListener = new HeaderTouchListener(); private View mExpandButton; private View mIcon; + private TextView mChildCount; public NotificationHeaderView(Context context) { this(context, null); @@ -66,6 +68,7 @@ public class NotificationHeaderView extends LinearLayout { mSubTextView = findViewById(com.android.internal.R.id.header_sub_text); mExpandButton = findViewById(com.android.internal.R.id.expand_button); mIcon = findViewById(com.android.internal.R.id.icon); + mChildCount = (TextView) findViewById(com.android.internal.R.id.number_of_children); } @Override @@ -132,6 +135,17 @@ public class NotificationHeaderView extends LinearLayout { updateTouchListener(); } + public void setChildCount(int childCount) { + if (childCount > 0) { + mChildCount.setText(getContext().getString( + com.android.internal.R.string.notification_children_count_bracketed, + childCount)); + mChildCount.setVisibility(VISIBLE); + } else { + mChildCount.setVisibility(GONE); + } + } + public class HeaderTouchListener implements View.OnTouchListener { private final ArrayList<Rect> mTouchRects = new ArrayList<>(); |
