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

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

Merge "Fixed a bug that the notifications were not animating when reset" into lmp-mr1-dev

parents b9744c1c 1a521f3e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
import android.text.TextUtils;
import android.util.Log;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.view.Display;
+16 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.service.notification.StatusBarNotification;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewStub;
import android.view.accessibility.AccessibilityEvent;
@@ -68,6 +69,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    private NotificationGuts mGuts;

    private StatusBarNotification mStatusBarNotification;
    private boolean mIsHeadsUp;

    public void setIconAnimationRunning(boolean running) {
        setIconAnimationRunning(running, mPublicLayout);
@@ -122,6 +124,10 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        return mStatusBarNotification;
    }

    public void setHeadsUp(boolean isHeadsUp) {
        mIsHeadsUp = isHeadsUp;
    }

    public interface ExpansionLogger {
        public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
    }
@@ -147,20 +153,27 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mShowingPublicInitialized = false;
        mIsSystemExpanded = false;
        mExpansionDisabled = false;
        mPublicLayout.reset();
        mPrivateLayout.reset();
        mPublicLayout.reset(mIsHeadsUp);
        mPrivateLayout.reset(mIsHeadsUp);
        resetHeight();
        logExpansionEvent(false, wasExpanded);
    }

    public void resetHeight() {
        super.resetHeight();
        if (mIsHeadsUp) {
            resetActualHeight();
        }
        mMaxExpandHeight = 0;
        mWasReset = true;
        onHeightReset();
        requestLayout();
    }

    @Override
    protected boolean filterMotionEvent(MotionEvent event) {
        return mIsHeadsUp || super.filterMotionEvent(event);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
+6 −2
Original line number Diff line number Diff line
@@ -103,9 +103,13 @@ public abstract class ExpandableView extends FrameLayout {
        }
    }

    protected void resetHeight() {
    /**
     * Resets the height of the view on the next layout pass
     */
    protected void resetActualHeight() {
        mActualHeight = 0;
        mActualHeightInitialized = false;
        requestLayout();
    }

    protected int getInitialHeight() {
@@ -120,7 +124,7 @@ public abstract class ExpandableView extends FrameLayout {
        return false;
    }

    private boolean filterMotionEvent(MotionEvent event) {
    protected boolean filterMotionEvent(MotionEvent event) {
        return event.getActionMasked() != MotionEvent.ACTION_DOWN
                || event.getY() > mClipTopAmount && event.getY() < mActualHeight;
    }
+5 −3
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ public class NotificationContentView extends FrameLayout {
    public NotificationContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mFadePaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.ADD));
        reset();
        reset(true);
    }

    @Override
@@ -89,7 +89,7 @@ public class NotificationContentView extends FrameLayout {
        updateVisibility();
    }

    public void reset() {
    public void reset(boolean resetActualHeight) {
        if (mContractedChild != null) {
            mContractedChild.animate().cancel();
        }
@@ -100,8 +100,10 @@ public class NotificationContentView extends FrameLayout {
        mContractedChild = null;
        mExpandedChild = null;
        mSmallHeight = getResources().getDimensionPixelSize(R.dimen.notification_min_height);
        mActualHeight = mSmallHeight;
        mContractedVisible = true;
        if (resetActualHeight) {
            mActualHeight = mSmallHeight;
        }
    }

    public View getContractedChild() {
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ public class HeadsUpNotificationView extends FrameLayout implements SwipeHelper.
        if (mHeadsUp != null) {
            mHeadsUp.row.setSystemExpanded(true);
            mHeadsUp.row.setSensitive(false);
            mHeadsUp.row.setHeadsUp(true);
            mHeadsUp.row.setHideSensitive(
                    false, false /* animated */, 0 /* delay */, 0 /* duration */);
            if (mContentHolder == null) {