Search in sources :

Example 26 with StatusBarIconView

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);
}
Also used : PendingIntent(android.app.PendingIntent) RemoteException(android.os.RemoteException) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 27 with StatusBarIconView

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);
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) NinePatchDrawable(android.graphics.drawable.NinePatchDrawable) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 28 with StatusBarIconView

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++;
            }
        }
    }
}
Also used : Path(android.graphics.Path) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) Paint(android.graphics.Paint) Point(android.graphics.Point) Notification(android.app.Notification) StatusBarNotification(android.service.notification.StatusBarNotification) StatusBarNotification(android.service.notification.StatusBarNotification) StatusBarIcon(com.android.internal.statusbar.StatusBarIcon) NotificationData(com.android.systemui.statusbar.NotificationData) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 29 with StatusBarIconView

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));
}
Also used : StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 30 with StatusBarIconView

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);
}
Also used : StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Aggregations

StatusBarIconView (com.android.systemui.statusbar.StatusBarIconView)42 LinearLayout (android.widget.LinearLayout)17 NotificationData (com.android.systemui.statusbar.NotificationData)8 StatusBarIcon (com.android.internal.statusbar.StatusBarIcon)7 ArrayList (java.util.ArrayList)7 View (android.view.View)6 ImageView (android.widget.ImageView)6 Point (android.graphics.Point)4 StatusBarNotification (android.service.notification.StatusBarNotification)4 ColorDrawable (android.graphics.drawable.ColorDrawable)3 Drawable (android.graphics.drawable.Drawable)3 Notification (android.app.Notification)2 NinePatchDrawable (android.graphics.drawable.NinePatchDrawable)2 Entry (com.android.systemui.statusbar.NotificationData.Entry)2 PendingIntent (android.app.PendingIntent)1 Paint (android.graphics.Paint)1 Path (android.graphics.Path)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 IBinder (android.os.IBinder)1 RemoteException (android.os.RemoteException)1