Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb76d01a authored by Wysie's avatar Wysie
Browse files

Added code to make notification items configurable.

parent c0c06d19
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1376,6 +1376,10 @@ public final class Settings {
        public static final String PLMN_LABEL_COLOR = "plmnLabel_color";
        public static final String CLEAR_BUTTON_LABEL_COLOR = "clearbutton_color";
        
        public static final String NOTIF_ITEM_TITLE_COLOR = "notifications_title_color";
        public static final String NOTIF_ITEM_TEXT_COLOR = "notifications_text_color";
        public static final String NOTIF_ITEM_TIME_COLOR = "notifications_time_color";
        
        /**
         * Whether the audible DTMF tones are played by the dialer when dialing. The value is
         * boolean (1 or 0).
+23 −3
Original line number Diff line number Diff line
@@ -224,6 +224,10 @@ public class StatusBarService extends IStatusBar.Stub
    int mViewDelta;
    int[] mAbsPos = new int[2];
    private int blackColor = 0xff000000;
    private int whiteColor = 0xffffffff;
    private int notificationTitleColor = blackColor;
    private int notificationTextColor = blackColor;
    private int notificationTimeColor = blackColor;
    
    // for disabling the status bar
    ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>();
@@ -234,6 +238,9 @@ public class StatusBarService extends IStatusBar.Stub
     */
    public StatusBarService(Context context) {
        mContext = context;
        notificationTitleColor = Settings.System.getInt(mContext.getContentResolver(), Settings.System.NOTIF_ITEM_TITLE_COLOR, blackColor);
        notificationTextColor = Settings.System.getInt(mContext.getContentResolver(), Settings.System.NOTIF_ITEM_TEXT_COLOR, blackColor);
        notificationTimeColor = Settings.System.getInt(mContext.getContentResolver(), Settings.System.NOTIF_ITEM_TIME_COLOR, blackColor);
        mDisplay = ((WindowManager)context.getSystemService(
                Context.WINDOW_SERVICE)).getDefaultDisplay();
        makeStatusBarView(context);
@@ -856,6 +863,19 @@ public class StatusBarService extends IStatusBar.Stub
            Log.e(TAG, "couldn't inflate view for package " + n.pkg, exception);
            return null;
        }
        
        //Try-catch cause it does not work with QuickSettings, possibly other apps too :( (Won't work thru XML as well)
        try {
            TextView tv1 = (TextView) child.findViewById(com.android.internal.R.id.title);
            TextView tv2 = (TextView) child.findViewById(com.android.internal.R.id.text);
            TextView tv3 = (TextView) child.findViewById(com.android.internal.R.id.time);
            tv1.setTextColor(notificationTitleColor);
            tv2.setTextColor(notificationTextColor);
            tv3.setTextColor(notificationTimeColor);
        }
        catch (Exception e) {
        }
        
        content.addView(child);

        row.setDrawingCacheEnabled(true);
@@ -1707,9 +1727,9 @@ public class StatusBarService extends IStatusBar.Stub
    
    private void updateColors() {
        mDateView.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.DATE_COLOR, blackColor));
        mNoNotificationsTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.NO_NOTIF_COLOR, blackColor));
        mLatestTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.LATEST_NOTIF_COLOR, blackColor));
        mOngoingTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.ONGOING_NOTIF_COLOR, blackColor));
        mNoNotificationsTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.NO_NOTIF_COLOR, whiteColor));
        mLatestTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.LATEST_NOTIF_COLOR, whiteColor));
        mOngoingTitle.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.ONGOING_NOTIF_COLOR, whiteColor));
        mSpnLabel.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.SPN_LABEL_COLOR, blackColor));
        mPlmnLabel.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.PLMN_LABEL_COLOR, blackColor));
        mClearButton.setTextColor(Settings.System.getInt(mContext.getContentResolver(), Settings.System.CLEAR_BUTTON_LABEL_COLOR, blackColor));