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

Commit 19ba7050 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed that notification content were sometimes not readable

Because dark was only called on the visible view.

Change-Id: I4c9a00e7fcc29c107432fc7f0c61bc095c2e77a0
parent 087ee895
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -460,16 +460,16 @@ public class NotificationContentView extends FrameLayout {
        if (mDark == dark || mContractedChild == null) return;
        mDark = dark;
        dark = dark && !mShowingLegacyBackground;
        if (mVisibleType == VISIBLE_TYPE_CONTRACTED) {
        if (mVisibleType == VISIBLE_TYPE_CONTRACTED || !dark) {
            mContractedWrapper.setDark(dark, fade, delay);
        }
        if (mVisibleType == VISIBLE_TYPE_EXPANDED) {
        if (mVisibleType == VISIBLE_TYPE_EXPANDED || (mExpandedChild != null && !dark)) {
            mExpandedWrapper.setDark(dark, fade, delay);
        }
        if (mVisibleType == VISIBLE_TYPE_HEADSUP) {
        if (mVisibleType == VISIBLE_TYPE_HEADSUP || (mHeadsUpChild != null && !dark)) {
            mHeadsUpWrapper.setDark(dark, fade, delay);
        }
        if (mSingleLineView != null && mVisibleType == VISIBLE_TYPE_SINGLELINE) {
        if (mSingleLineView != null && (mVisibleType == VISIBLE_TYPE_SINGLELINE || !dark)) {
            mSingleLineView.setDark(dark, fade, delay);
        }
    }
+4 −0
Original line number Diff line number Diff line
@@ -35,6 +35,10 @@ public class NotificationCustomViewWrapper extends NotificationViewWrapper {

    @Override
    public void setDark(boolean dark, boolean fade, long delay) {
        if (dark == mDark) {
            return;
        }
        super.setDark(dark, fade, delay);
        if (fade) {
            mInvertHelper.fade(dark, delay);
        } else {
+5 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {

    @Override
    public void notifyContentUpdated(StatusBarNotification notification) {
        super.notifyContentUpdated(notification);
        // Reinspect the notification.
        resolveHeaderViews();
        updateInvertHelper();
@@ -150,6 +151,10 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {

    @Override
    public void setDark(boolean dark, boolean fade, long delay) {
        if (dark == mDark) {
            return;
        }
        super.setDark(dark, fade, delay);
        if (fade) {
            mInvertHelper.fade(dark, delay);
        } else {
+3 −0
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp

    @Override
    public void setDark(boolean dark, boolean fade, long delay) {
        if (dark == mDark) {
            return;
        }
        super.setDark(dark, fade, delay);
        setPictureGrayscale(dark, fade, delay);
        setProgressBarDark(dark, fade, delay);
+7 −2
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.systemui.statusbar.TransformableView;
public abstract class NotificationViewWrapper implements TransformableView {

    protected final View mView;
    protected boolean mDark;

    public static NotificationViewWrapper wrap(Context ctx, View v) {
        if (v.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
@@ -56,13 +57,17 @@ public abstract class NotificationViewWrapper implements TransformableView {
     * @param fade whether to animate the transition if the mode changes
     * @param delay if fading, the delay of the animation
     */
    public abstract void setDark(boolean dark, boolean fade, long delay);
    public void setDark(boolean dark, boolean fade, long delay) {
        mDark = dark;
    }

    /**
     * Notifies this wrapper that the content of the view might have changed.
     * @param notification
     */
    public void notifyContentUpdated(StatusBarNotification notification) {};
    public void notifyContentUpdated(StatusBarNotification notification) {
        mDark = false;
    };

    /**
     * Update the appearance of the expand button.