use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ParanoidAndroid.
the class PhoneStatusBar method addNotification.
public void addNotification(IBinder key, StatusBarNotification notification) {
if (DEBUG)
Slog.d(TAG, "addNotification score=" + notification.getScore());
StatusBarIconView iconView = addNotificationViews(key, notification);
if (iconView == null)
return;
boolean immersive = false;
try {
immersive = ActivityManagerNative.getDefault().isTopActivityImmersive();
if (DEBUG) {
Slog.d(TAG, "Top activity is " + (immersive ? "immersive" : "not immersive"));
}
} catch (RemoteException ex) {
}
if (notification.getNotification().fullScreenIntent != null) {
// Stop screensaver if the notification has a full-screen intent.
// (like an incoming phone call)
awakenDreams();
// not immersive & a full-screen alert should be shown
if (DEBUG)
Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
try {
notification.getNotification().fullScreenIntent.send();
} catch (PendingIntent.CanceledException e) {
}
} else if (!mRecreating) {
// show the ticker if there isn't an intruder too
if (mCurrentlyIntrudingNotification == null) {
tick(null, notification, true);
}
}
// Recalculate the position of the sliding windows and the titles.
setAreThereNotifications();
updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
}
use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ParanoidAndroid.
the class PhoneStatusBar method updateIcon.
public void updateIcon(String slot, int index, int viewIndex, StatusBarIcon old, StatusBarIcon icon) {
if (SPEW)
Slog.d(TAG, "updateIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex + " old=" + old + " icon=" + icon);
Drawable iconDrawable = StatusBarIconView.getIcon(mContext, icon);
if (mLastIconColor == null || mLastIconColor.isLastColorNull) {
iconDrawable.clearColorFilter();
} else {
iconDrawable.setColorFilter(mLastIconColor.lastColor, PorterDuff.Mode.SRC_IN);
}
StatusBarIconView view = (StatusBarIconView) mStatusIcons.getChildAt(viewIndex);
view.set(icon);
}
use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ParanoidAndroid.
the class PieMenu method getNotifications.
private void getNotifications() {
NotificationData notifData = mPanel.getBar().getNotificationData();
if (notifData != null) {
mNotificationText = new String[notifData.size()];
mNotificationIcon = new Bitmap[notifData.size()];
mNotificationPath = new Path[notifData.size()];
for (int i = 0; i < notifData.size(); i++) {
NotificationData.Entry entry = notifData.get(i);
StatusBarNotification statusNotif = entry.notification;
if (statusNotif == null)
continue;
boolean hide = statusNotif.getPackageName().equals("com.paranoid.halo");
if (hide) {
mHiddenNotification++;
continue;
}
Notification notif = statusNotif.getNotification();
if (notif == null)
continue;
CharSequence tickerText = notif.tickerText;
if (tickerText == null)
continue;
if (entry.icon != null) {
StatusBarIconView iconView = entry.icon;
StatusBarIcon icon = iconView.getStatusBarIcon();
Drawable drawable = entry.icon.getIcon(mContext, icon);
if (!(drawable instanceof BitmapDrawable))
continue;
mNotificationIcon[mNotificationCount] = ((BitmapDrawable) drawable).getBitmap();
String text = tickerText.toString();
if (text.length() > 100)
text = text.substring(0, 100) + "..";
mNotificationText[mNotificationCount] = text;
Path notifictionPath = new Path();
notifictionPath.addCircle(mCenter.x, mCenter.y, mNotificationsRadius + (mNotificationsRowSize * mNotificationCount) + (mNotificationsRowSize - mNotificationTextSize), Path.Direction.CW);
mNotificationPath[mNotificationCount] = notifictionPath;
mNotificationCount++;
}
}
}
}
use of com.android.systemui.statusbar.StatusBarIconView in project platform_frameworks_base by android.
the class StatusBarIconController method applyIconTint.
private void applyIconTint() {
for (int i = 0; i < mStatusIcons.getChildCount(); i++) {
StatusBarIconView v = (StatusBarIconView) mStatusIcons.getChildAt(i);
v.setImageTintList(ColorStateList.valueOf(getTint(mTintArea, v, mIconTint)));
}
mSignalCluster.setIconTint(mIconTint, mDarkIntensity, mTintArea);
mBatteryMeterView.setDarkIntensity(isInArea(mTintArea, mBatteryMeterView) ? mDarkIntensity : 0);
mClock.setTextColor(getTint(mTintArea, mClock, mIconTint));
}
use of com.android.systemui.statusbar.StatusBarIconView in project platform_frameworks_base by android.
the class StatusBarIconController method dump.
public void dump(PrintWriter pw) {
int N = mStatusIcons.getChildCount();
pw.println(" icon views: " + N);
for (int i = 0; i < N; i++) {
StatusBarIconView ic = (StatusBarIconView) mStatusIcons.getChildAt(i);
pw.println(" [" + i + "] icon=" + ic);
}
super.dump(pw);
}
Aggregations