public StatusBarIconController( Context context, View statusBar, View keyguardStatusBar, PhoneStatusBar phoneStatusBar) { mContext = context; mPhoneStatusBar = phoneStatusBar; mNotificationColorUtil = NotificationColorUtil.getInstance(context); mSystemIconArea = (LinearLayout) statusBar.findViewById(R.id.system_icon_area); mStatusIcons = (LinearLayout) statusBar.findViewById(R.id.statusIcons); mSignalCluster = (SignalClusterView) statusBar.findViewById(R.id.signal_cluster); mNotificationIconArea = statusBar.findViewById(R.id.notification_icon_area_inner); mNotificationIcons = (IconMerger) statusBar.findViewById(R.id.notificationIcons); mMoreIcon = (ImageView) statusBar.findViewById(R.id.moreIcon); mNotificationIcons.setOverflowIndicator(mMoreIcon); mStatusIconsKeyguard = (LinearLayout) keyguardStatusBar.findViewById(R.id.statusIcons); mBatteryMeterView = (BatteryMeterView) statusBar.findViewById(R.id.battery); mNetworkTraffic = (NetworkTraffic) statusBar.findViewById(R.id.networkTraffic); mCarrier = (TextView) statusBar.findViewById(R.id.statusbar_carrier_text); mLinearOutSlowIn = AnimationUtils.loadInterpolator(mContext, android.R.interpolator.linear_out_slow_in); mFastOutSlowIn = AnimationUtils.loadInterpolator(mContext, android.R.interpolator.fast_out_slow_in); mDarkModeIconColorSingleTone = context.getColor(R.color.dark_mode_icon_color_single_tone); mLightModeIconColorSingleTone = context.getColor(R.color.light_mode_icon_color_single_tone); mHandler = new Handler(); mClockController = new ClockController(statusBar, mNotificationIcons, mHandler); mCenterClockLayout = statusBar.findViewById(R.id.center_clock_layout); updateResources(); TunerService.get(mContext).addTunable(this, ICON_BLACKLIST); }
private boolean isGrayscale(StatusBarIconView v) { Object isGrayscale = v.getTag(R.id.icon_is_grayscale); if (isGrayscale != null) { return Boolean.TRUE.equals(isGrayscale); } boolean grayscale = mNotificationColorUtil.isGrayscaleIcon(v.getDrawable()); v.setTag(R.id.icon_is_grayscale, grayscale); return grayscale; }