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;
}
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));
}
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);
}
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();
}
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);
}
Aggregations