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

Commit 945b045d authored by Selim Cinek's avatar Selim Cinek Committed by Automerger Merge Worker
Browse files

Merge changes I7993fde3,Ia804fc9b into rvc-dev am: 3d2ecec8

Change-Id: Icb4add241b0465dcdc2f11cf7696b8efb37973fe
parents ad3f2a70 3d2ecec8
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -271,6 +271,10 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        }
        }
    }
    }


    public boolean isActive() {
        return mActivated;
    }

    private void startActivateAnimation(final boolean reverse) {
    private void startActivateAnimation(final boolean reverse) {
        if (!isAttachedToWindow()) {
        if (!isAttachedToWindow()) {
            return;
            return;
+1 −1
Original line number Original line Diff line number Diff line
@@ -111,7 +111,7 @@ public class ActivatableNotificationViewController {
            if (mNeedsDimming && ev.getActionMasked() == MotionEvent.ACTION_DOWN
            if (mNeedsDimming && ev.getActionMasked() == MotionEvent.ACTION_DOWN
                    && mView.disallowSingleClick(ev)
                    && mView.disallowSingleClick(ev)
                    && !mAccessibilityManager.isTouchExplorationEnabled()) {
                    && !mAccessibilityManager.isTouchExplorationEnabled()) {
                if (!mView.isActivated()) {
                if (!mView.isActive()) {
                    return true;
                    return true;
                } else if (!mDoubleTapHelper.isWithinDoubleTapSlop(ev)) {
                } else if (!mDoubleTapHelper.isWithinDoubleTapSlop(ev)) {
                    mBlockNextTouch = true;
                    mBlockNextTouch = true;
+11 −0
Original line number Original line Diff line number Diff line
@@ -40,6 +40,7 @@ class NotificationConversationTemplateViewWrapper constructor(
    private var conversationIcon: View? = null
    private var conversationIcon: View? = null
    private var conversationBadge: View? = null
    private var conversationBadge: View? = null
    private var expandButton: View? = null
    private var expandButton: View? = null
    private lateinit var expandButtonContainer: View
    private var messagingLinearLayout: MessagingLinearLayout? = null
    private var messagingLinearLayout: MessagingLinearLayout? = null


    init {
    init {
@@ -56,6 +57,8 @@ class NotificationConversationTemplateViewWrapper constructor(
                com.android.internal.R.id.conversation_icon_badge)
                com.android.internal.R.id.conversation_icon_badge)
        expandButton = conversationLayout.requireViewById(
        expandButton = conversationLayout.requireViewById(
                com.android.internal.R.id.expand_button)
                com.android.internal.R.id.expand_button)
        expandButtonContainer = conversationLayout.requireViewById(
                com.android.internal.R.id.expand_button_container)
    }
    }


    override fun onContentUpdated(row: ExpandableNotificationRow) {
    override fun onContentUpdated(row: ExpandableNotificationRow) {
@@ -90,6 +93,14 @@ class NotificationConversationTemplateViewWrapper constructor(
        conversationLayout.updateExpandability(expandable, onClickListener)
        conversationLayout.updateExpandability(expandable, onClickListener)
    }
    }


    override fun disallowSingleClick(x: Float, y: Float): Boolean {
        if (expandButtonContainer.visibility == View.VISIBLE
                && isOnView(expandButtonContainer, x, y)) {
            return true
        }
        return super.disallowSingleClick(x, y)
    }

    override fun getMinLayoutHeight(): Int {
    override fun getMinLayoutHeight(): Int {
        if (mActionsContainer != null && mActionsContainer.visibility != View.GONE) {
        if (mActionsContainer != null && mActionsContainer.visibility != View.GONE) {
            return minHeightWithActions
            return minHeightWithActions
+0 −13
Original line number Original line Diff line number Diff line
@@ -58,7 +58,6 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
    private TextView mText;
    private TextView mText;
    protected View mActionsContainer;
    protected View mActionsContainer;
    private ImageView mReplyAction;
    private ImageView mReplyAction;
    private Rect mTmpRect = new Rect();


    private int mContentHeight;
    private int mContentHeight;
    private int mMinHeightHint;
    private int mMinHeightHint;
@@ -271,18 +270,6 @@ public class NotificationTemplateViewWrapper extends NotificationHeaderViewWrapp
        return super.disallowSingleClick(x, y);
        return super.disallowSingleClick(x, y);
    }
    }


    private boolean isOnView(View view, float x, float y) {
        View searchView = (View) view.getParent();
        while (searchView != null && !(searchView instanceof ExpandableNotificationRow)) {
            searchView.getHitRect(mTmpRect);
            x -= mTmpRect.left;
            y -= mTmpRect.top;
            searchView = (View) searchView.getParent();
        }
        view.getHitRect(mTmpRect);
        return mTmpRect.contains((int) x,(int) y);
    }

    @Override
    @Override
    public void onContentUpdated(ExpandableNotificationRow row) {
    public void onContentUpdated(ExpandableNotificationRow row) {
        // Reinspect the notification. Before the super call, because the super call also updates
        // Reinspect the notification. Before the super call, because the super call also updates
+22 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Build;
@@ -49,6 +50,7 @@ public abstract class NotificationViewWrapper implements TransformableView {


    protected final View mView;
    protected final View mView;
    protected final ExpandableNotificationRow mRow;
    protected final ExpandableNotificationRow mRow;
    private final Rect mTmpRect = new Rect();


    protected int mBackgroundColor = 0;
    protected int mBackgroundColor = 0;


@@ -305,6 +307,26 @@ public abstract class NotificationViewWrapper implements TransformableView {
        return false;
        return false;
    }
    }


    /**
     * Is a given x and y coordinate on a view.
     *
     * @param view the view to be checked
     * @param x the x coordinate, relative to the ExpandableNotificationRow
     * @param y the y coordinate, relative to the ExpandableNotificationRow
     * @return {@code true} if it is on the view
     */
    protected boolean isOnView(View view, float x, float y) {
        View searchView = (View) view.getParent();
        while (searchView != null && !(searchView instanceof ExpandableNotificationRow)) {
            searchView.getHitRect(mTmpRect);
            x -= mTmpRect.left;
            y -= mTmpRect.top;
            searchView = (View) searchView.getParent();
        }
        view.getHitRect(mTmpRect);
        return mTmpRect.contains((int) x,(int) y);
    }

    public int getMinLayoutHeight() {
    public int getMinLayoutHeight() {
        return 0;
        return 0;
    }
    }