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

Commit 70c5c30a authored by Selim Cinek's avatar Selim Cinek Committed by Android (Google) Code Review
Browse files

Merge changes Ic5ceb729,I51fab5be,Id7abd858,Ic5fce695,I14a75cd6, ...

* changes:
  Fixed the interactivness of the shelf on the keyguard
  Follow up fixes for expandhelper
  Fix guts not expanding when QSPanel is expanded
  Fixed an issue where the setVisibility wasn't annotated
  Fixed a crash when a notification is updated
  Improved the performance of the shelf / scrim
  Fixed a caching issue where icons could stay greyscale
parents fdaa9c58 c681346a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ public class CachingIconView extends ImageView {
    }

    @Override
    @RemotableViewMethod
    public void setVisibility(int visibility) {
        mDesiredVisibility = visibility;
        updateVisibility();
+4 −1
Original line number Diff line number Diff line
@@ -326,7 +326,7 @@ public class ExpandHelper implements Gefingerpoken {
            case MotionEvent.ACTION_CANCEL:
            case MotionEvent.ACTION_UP:
                if (DEBUG) Log.d(TAG, "up/cancel");
                finishExpanding(ev.getActionMasked() == MotionEvent.ACTION_CANCEL,
                finishExpanding(ev.getActionMasked() == MotionEvent.ACTION_CANCEL /* forceAbort */,
                        getCurrentVelocity());
                clearView();
                break;
@@ -587,6 +587,9 @@ public class ExpandHelper implements Gefingerpoken {
            mFlingAnimationUtils.apply(mScaleAnimation, currentHeight, targetHeight, velocity);
            mScaleAnimation.start();
        } else {
            if (targetHeight != currentHeight) {
                mScaler.setHeight(targetHeight);
            }
            mCallback.setUserExpandedChild(mResizedView, nowExpanded);
            mCallback.setUserLockedChild(mResizedView, false);
        }
+17 −4
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    private int mStartTint;
    private int mOverrideTint;
    private float mOverrideAmount;
    private boolean mShadowHidden;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -210,6 +211,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        super.onFinishInflate();
        mBackgroundNormal = (NotificationBackgroundView) findViewById(R.id.backgroundNormal);
        mFakeShadow = (FakeShadowView) findViewById(R.id.fake_shadow);
        mShadowHidden = mFakeShadow.getVisibility() != VISIBLE;
        mBackgroundDimmed = (NotificationBackgroundView) findViewById(R.id.backgroundDimmed);
        mBackgroundNormal.setCustomBackground(R.drawable.notification_material_bg);
        mBackgroundDimmed.setCustomBackground(R.drawable.notification_material_bg_dim);
@@ -249,7 +251,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        boolean result;
        if (mDimmed && !isTouchExplorationEnabled()) {
        if (mDimmed && !isTouchExplorationEnabled() && isInteractive()) {
            boolean wasActivated = mActivated;
            result = handleTouchEventDimmed(event);
            if (wasActivated && result && event.getAction() == MotionEvent.ACTION_UP) {
@@ -261,6 +263,13 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        return result;
    }

    /**
     * @return whether this view is interactive and can be double tapped
     */
    protected boolean isInteractive() {
        return true;
    }

    @Override
    public void drawableHotspotChanged(float x, float y) {
        if (!mDimmed){
@@ -1020,10 +1029,14 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    @Override
    public void setFakeShadowIntensity(float shadowIntensity, float outlineAlpha, int shadowYEnd,
            int outlineTranslation) {
        boolean hiddenBefore = mShadowHidden;
        mShadowHidden = shadowIntensity == 0.0f;
        if (!mShadowHidden || !hiddenBefore) {
            mFakeShadow.setFakeShadowTranslationZ(shadowIntensity * (getTranslationZ()
                            + FakeShadowView.SHADOW_SIBLING_TRESHOLD), outlineAlpha, shadowYEnd,
                    outlineTranslation);
        }
    }

    public int getBackgroundColorWithoutTint() {
        return calculateBgColor(false /* withTint */, false /* withOverride */);
+8 −9
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ import java.util.Stack;
public abstract class BaseStatusBar extends SystemUI implements
        CommandQueue.Callbacks, ActivatableNotificationView.OnActivatedListener,
        ExpandableNotificationRow.ExpansionLogger, NotificationData.Environment,
        ExpandableNotificationRow.OnExpandClickListener, OnGutsClosedListener {
        ExpandableNotificationRow.OnExpandClickListener {
    public static final String TAG = "StatusBar";
    public static final boolean DEBUG = false;
    public static final boolean MULTIUSER_DEBUG = false;
@@ -1041,7 +1041,12 @@ public abstract class BaseStatusBar extends SystemUI implements
        PackageManager pmUser = getPackageManagerForUser(mContext, sbn.getUser().getIdentifier());
        row.setTag(sbn.getPackageName());
        final NotificationGuts guts = row.getGuts();
        guts.setClosedListener(this);
        guts.setClosedListener((NotificationGuts g) -> {
            if (!row.isRemoved()) {
                mStackScroller.onHeightChanged(row, !isPanelFullyCollapsed() /* needsAnimation */);
            }
            mNotificationGutsExposed = null;
        });

        final INotificationManager iNotificationManager = INotificationManager.Stub.asInterface(
                ServiceManager.getService(Context.NOTIFICATION_SERVICE));
@@ -1149,7 +1154,7 @@ public abstract class BaseStatusBar extends SystemUI implements
                        guts.setExposed(true /* exposed */,
                                mState == StatusBarState.KEYGUARD /* needsFalsingProtection */);
                        row.closeRemoteInput();
                        mStackScroller.onHeightChanged(null, true /* needsAnimation */);
                        mStackScroller.onHeightChanged(row, true /* needsAnimation */);
                        mNotificationGutsExposed = guts;
                    }
                });
@@ -1182,12 +1187,6 @@ public abstract class BaseStatusBar extends SystemUI implements
        }
    }

    @Override
    public void onGutsClosed(NotificationGuts guts) {
        mStackScroller.onHeightChanged(null, true /* needsAnimation */);
        mNotificationGutsExposed = null;
    }

    @Override
    public void showRecentApps(boolean triggeredFromAltTab, boolean fromHome) {
        int msg = MSG_SHOW_RECENT_APPS;
+0 −5
Original line number Diff line number Diff line
@@ -293,10 +293,6 @@ public class NotificationContentView extends FrameLayout {
    }

    public void reset() {
        if (mContractedChild != null) {
            mContractedChild.animate().cancel();
            removeView(mContractedChild);
        }
        mPreviousExpandedRemoteInputIntent = null;
        if (mExpandedRemoteInput != null) {
            mExpandedRemoteInput.onNotificationUpdateOrReset();
@@ -327,7 +323,6 @@ public class NotificationContentView extends FrameLayout {
            removeView(mHeadsUpChild);
            mHeadsUpRemoteInput = null;
        }
        mContractedChild = null;
        mExpandedChild = null;
        mHeadsUpChild = null;
    }
Loading