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

Commit a8990422 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Fix dark mode for custom views" into mnc-dev

parents 80b34d7b 021eee53
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1381,7 +1381,6 @@ public abstract class BaseStatusBar extends SystemUI implements
                    R.layout.notification_public_default,
                    R.layout.notification_public_default,
                    contentContainerPublic, false);
                    contentContainerPublic, false);
            publicViewLocal.setIsRootNamespace(true);
            publicViewLocal.setIsRootNamespace(true);
            contentContainerPublic.setContractedChild(publicViewLocal);


            final TextView title = (TextView) publicViewLocal.findViewById(R.id.title);
            final TextView title = (TextView) publicViewLocal.findViewById(R.id.title);
            try {
            try {
@@ -1447,6 +1446,7 @@ public abstract class BaseStatusBar extends SystemUI implements
                    mContext.getResources().getConfiguration().fontScale);
                    mContext.getResources().getConfiguration().fontScale);
            title.setPadding(0, topPadding, 0, 0);
            title.setPadding(0, topPadding, 0, 0);


            contentContainerPublic.setContractedChild(publicViewLocal);
            entry.autoRedacted = true;
            entry.autoRedacted = true;
        }
        }


+2 −2
Original line number Original line Diff line number Diff line
@@ -311,9 +311,9 @@ public class NotificationContentView extends FrameLayout {
        }
        }
        int visibleType = calculateVisibleType();
        int visibleType = calculateVisibleType();
        if (visibleType != mVisibleType || force) {
        if (visibleType != mVisibleType || force) {
            if (animate && (visibleType == VISIBLE_TYPE_EXPANDED && mExpandedChild != null)
            if (animate && ((visibleType == VISIBLE_TYPE_EXPANDED && mExpandedChild != null)
                    || (visibleType == VISIBLE_TYPE_HEADSUP && mHeadsUpChild != null)
                    || (visibleType == VISIBLE_TYPE_HEADSUP && mHeadsUpChild != null)
                    || visibleType == VISIBLE_TYPE_CONTRACTED) {
                    || visibleType == VISIBLE_TYPE_CONTRACTED)) {
                runSwitchAnimation(visibleType);
                runSwitchAnimation(visibleType);
            } else {
            } else {
                updateViewVisibilities(visibleType);
                updateViewVisibilities(visibleType);
+3 −3
Original line number Original line Diff line number Diff line
@@ -149,9 +149,6 @@ public class StackScrollState {
        // apply dimming
        // apply dimming
        view.setDimmed(state.dimmed, false /* animate */);
        view.setDimmed(state.dimmed, false /* animate */);


        // apply dark
        view.setDark(state.dark, false /* animate */, 0 /* delay */);

        // apply hiding sensitive
        // apply hiding sensitive
        view.setHideSensitive(
        view.setHideSensitive(
                state.hideSensitive, false /* animated */, 0 /* delay */, 0 /* duration */);
                state.hideSensitive, false /* animated */, 0 /* delay */, 0 /* duration */);
@@ -159,6 +156,9 @@ public class StackScrollState {
        // apply speed bump state
        // apply speed bump state
        view.setBelowSpeedBump(state.belowSpeedBump);
        view.setBelowSpeedBump(state.belowSpeedBump);


        // apply dark
        view.setDark(state.dark, false /* animate */, 0 /* delay */);

        // apply clipping
        // apply clipping
        float oldClipTopAmount = view.getClipTopAmount();
        float oldClipTopAmount = view.getClipTopAmount();
        if (oldClipTopAmount != state.clipTopAmount) {
        if (oldClipTopAmount != state.clipTopAmount) {
+3 −3
Original line number Original line Diff line number Diff line
@@ -243,9 +243,6 @@ public class StackStateAnimator {
        // start dimmed animation
        // start dimmed animation
        child.setDimmed(viewState.dimmed, mAnimationFilter.animateDimmed);
        child.setDimmed(viewState.dimmed, mAnimationFilter.animateDimmed);


        // start dark animation
        child.setDark(viewState.dark, mAnimationFilter.animateDark, delay);

        // apply speed bump state
        // apply speed bump state
        child.setBelowSpeedBump(viewState.belowSpeedBump);
        child.setBelowSpeedBump(viewState.belowSpeedBump);


@@ -253,6 +250,9 @@ public class StackStateAnimator {
        child.setHideSensitive(viewState.hideSensitive, mAnimationFilter.animateHideSensitive,
        child.setHideSensitive(viewState.hideSensitive, mAnimationFilter.animateHideSensitive,
                delay, duration);
                delay, duration);


        // start dark animation
        child.setDark(viewState.dark, mAnimationFilter.animateDark, delay);

        if (wasAdded) {
        if (wasAdded) {
            child.performAddAnimation(delay, mCurrentLength);
            child.performAddAnimation(delay, mCurrentLength);
        }
        }