Search in sources :

Example 6 with StatusBarIconView

use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ParanoidAndroid.

the class PhoneStatusBar method recreateStatusBar.

private void recreateStatusBar() {
    mRecreating = true;
    mStatusBarContainer.removeAllViews();
    // extract icons from the soon-to-be recreated viewgroup.
    int nIcons = mStatusIcons.getChildCount();
    ArrayList<StatusBarIcon> icons = new ArrayList<StatusBarIcon>(nIcons);
    ArrayList<String> iconSlots = new ArrayList<String>(nIcons);
    for (int i = 0; i < nIcons; i++) {
        StatusBarIconView iconView = (StatusBarIconView) mStatusIcons.getChildAt(i);
        icons.add(iconView.getStatusBarIcon());
        iconSlots.add(iconView.getStatusBarSlot());
    }
    // extract notifications.
    int nNotifs = mNotificationData.size();
    ArrayList<Pair<IBinder, StatusBarNotification>> notifications = new ArrayList<Pair<IBinder, StatusBarNotification>>(nNotifs);
    copyNotifications(notifications, mNotificationData);
    mNotificationData.clear();
    makeStatusBarView();
    repositionNavigationBar();
    mNavigationBarView.updateResources();
    // recreate StatusBarIconViews.
    for (int i = 0; i < nIcons; i++) {
        StatusBarIcon icon = icons.get(i);
        String slot = iconSlots.get(i);
        addIcon(slot, i, i, icon);
    }
    // recreate notifications.
    for (int i = 0; i < nNotifs; i++) {
        Pair<IBinder, StatusBarNotification> notifData = notifications.get(i);
        addNotificationViews(notifData.first, notifData.second);
    }
    setAreThereNotifications();
    mStatusBarContainer.addView(mStatusBarWindow);
    updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
    mRecreating = false;
}
Also used : IBinder(android.os.IBinder) StatusBarNotification(android.service.notification.StatusBarNotification) ArrayList(java.util.ArrayList) StatusBarIcon(com.android.internal.statusbar.StatusBarIcon) Point(android.graphics.Point) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView) Pair(android.util.Pair)

Example 7 with StatusBarIconView

use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ParanoidAndroid.

the class PhoneStatusBar method addIcon.

public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon) {
    if (SPEW)
        Slog.d(TAG, "addIcon slot=" + slot + " index=" + index + " viewIndex=" + viewIndex + " 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 = new StatusBarIconView(mContext, slot, null);
    view.set(icon);
    mStatusIcons.addView(view, viewIndex, new LinearLayout.LayoutParams(mIconSize, mIconSize));
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) NinePatchDrawable(android.graphics.drawable.NinePatchDrawable) LinearLayout(android.widget.LinearLayout) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 8 with StatusBarIconView

use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ResurrectionRemix.

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);
    mClockController.setTextColor(mTintArea, mIconTint);
    if (Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.STATUS_BAR_RR_LOGO_COLOR, 0xFFFFFFFF, UserHandle.USER_CURRENT) == 0xFFFFFFFF) {
        mRRLogo.setImageTintList(ColorStateList.valueOf(mIconTint));
        mRRLogoRight.setImageTintList(ColorStateList.valueOf(mIconTint));
        mRRLogoLeft.setImageTintList(ColorStateList.valueOf(mIconTint));
    }
    if (Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.STATUS_BAR_WEATHER_COLOR, 0xFFFFFFFF, UserHandle.USER_CURRENT) == 0xFFFFFFFF) {
        mWeather.setTextColor(mIconTint);
        mWeatherLeft.setTextColor(mIconTint);
    }
    if (Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.NETWORK_TRAFFIC_COLOR, 0xFFFFFFFF, UserHandle.USER_CURRENT) == 0xFFFFFFFF) {
        mNetworkTraffic.setDarkIntensity(mDarkIntensity);
    }
    if (Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.STATUS_BAR_CARRIER_COLOR, mContext.getResources().getColor(R.color.status_bar_clock_color), UserHandle.USER_CURRENT) == mContext.getResources().getColor(R.color.status_bar_clock_color)) {
        mCarrierLabel.setTextColor(mIconTint);
    }
    mCustomLogo = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.CUSTOM_LOGO_STYLE, 0, UserHandle.USER_CURRENT);
    int mCustomlogoColor = Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.CUSTOM_LOGO_COLOR, 0xFFFFFFFF, UserHandle.USER_CURRENT);
    if (mCustomlogoColor == 0xFFFFFFFF) {
        // we cant set imagetintlist on the last one. It is non colorable. Hence use a condition.
        if (mCustomLogo == 43) {
            mCLogo.setColorFilter(mCustomlogoColor, Mode.MULTIPLY);
            mCLogoLeft.setColorFilter(mCustomlogoColor, Mode.MULTIPLY);
            mCLogoRight.setColorFilter(mCustomlogoColor, Mode.MULTIPLY);
        } else {
            mCLogo.setImageTintList(ColorStateList.valueOf(mIconTint));
            mCLogoLeft.setImageTintList(ColorStateList.valueOf(mIconTint));
            mCLogoRight.setImageTintList(ColorStateList.valueOf(mIconTint));
        }
    }
    if (Settings.System.getIntForUser(mContext.getContentResolver(), Settings.System.STATUS_BAR_WEATHER_IMAGE_COLOR, 0xFFFFFFFF, UserHandle.USER_CURRENT) == 0xFFFFFFFF) {
        mWeatherImageView.setImageTintList(ColorStateList.valueOf(mIconTint));
        mLeftWeatherImageView.setImageTintList(ColorStateList.valueOf(mIconTint));
    }
    mBatteryLevelView.setTextColor(getTint(mTintArea, mBatteryLevelView, mIconTint));
    mPhoneStatusBar.setTickerTint(mIconTint);
}
Also used : StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 9 with StatusBarIconView

use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ResurrectionRemix.

the class StatusBarIconController method addSystemIcon.

private void addSystemIcon(int index, StatusBarIcon icon) {
    String slot = getSlot(index);
    int viewIndex = getViewIndex(index);
    boolean blocked = mIconBlacklist.contains(slot);
    StatusBarIconView view = new StatusBarIconView(mContext, slot, null, blocked);
    view.set(icon);
    LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, mIconSize);
    lp.setMargins(mIconHPadding, 0, mIconHPadding, 0);
    mStatusIcons.addView(view, viewIndex, lp);
    view = new StatusBarIconView(mContext, slot, null, blocked);
    view.set(icon);
    mStatusIconsKeyguard.addView(view, viewIndex, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, mIconSize));
    applyIconTint();
}
Also used : LinearLayout(android.widget.LinearLayout) StatusBarIconView(com.android.systemui.statusbar.StatusBarIconView)

Example 10 with StatusBarIconView

use of com.android.systemui.statusbar.StatusBarIconView in project android_frameworks_base by ResurrectionRemix.

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