summaryrefslogtreecommitdiff
path: root/core/java/android/view/NotificationHeaderView.java
diff options
context:
space:
mode:
authorSelim Cinek <cinek@google.com>2016-01-13 15:27:30 -0800
committerSelim Cinek <cinek@google.com>2016-01-21 19:42:49 -0800
commitc848c3a1b4e3b365fb42ad7e418f90def054ed5f (patch)
tree58969f497f83c113d86238a4a47495e79c44cd8f /core/java/android/view/NotificationHeaderView.java
parentda6f1d605b86207de53f9889229e092a542ed95e (diff)
Changed the work profile appearance
Change-Id: I0545ee9b18572b93f73b4cf54126cf03085b61b5
Diffstat (limited to 'core/java/android/view/NotificationHeaderView.java')
-rw-r--r--core/java/android/view/NotificationHeaderView.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/view/NotificationHeaderView.java b/core/java/android/view/NotificationHeaderView.java
index f125b0e60a66..6fd0e6711545 100644
--- a/core/java/android/view/NotificationHeaderView.java
+++ b/core/java/android/view/NotificationHeaderView.java
@@ -25,6 +25,8 @@ import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.TextView;
+import com.android.internal.R;
+
import java.util.ArrayList;
/**
@@ -44,6 +46,7 @@ public class NotificationHeaderView extends LinearLayout {
private ImageView mExpandButton;
private View mIcon;
private TextView mChildCount;
+ private View mProfileBadge;
private int mIconColor;
private int mOriginalNotificationColor;
private boolean mGroupHeader;
@@ -76,6 +79,7 @@ public class NotificationHeaderView extends LinearLayout {
mExpandButton = (ImageView) 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);
+ mProfileBadge = findViewById(com.android.internal.R.id.profile_badge);
}
@Override
@@ -120,12 +124,29 @@ public class NotificationHeaderView extends LinearLayout {
}
totalWidth = givenWidth;
}
+ if (mProfileBadge.getVisibility() != View.GONE) {
+ totalWidth = givenWidth;
+ }
setMeasuredDimension(totalWidth, givenHeight);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
+ if (mProfileBadge.getVisibility() != View.GONE) {
+ int paddingEnd = getPaddingEnd();
+ if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
+ mProfileBadge.layout(paddingEnd,
+ mProfileBadge.getTop(),
+ paddingEnd + mProfileBadge.getMeasuredWidth(),
+ mProfileBadge.getBottom());
+ } else {
+ mProfileBadge.layout(getWidth() - paddingEnd - mProfileBadge.getMeasuredWidth(),
+ mProfileBadge.getTop(),
+ getWidth() - paddingEnd,
+ mProfileBadge.getBottom());
+ }
+ }
updateTouchListener();
}