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

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

Merge changes Ie009b2c3,I313b5334,Iae36fc6b

* changes:
  Animating the statusbar icons now when closing
  Fixed a few issues around notifications and density changes
  All touches to low priority headers should be accepted
parents 1ec752f2 24176c33
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -4177,7 +4177,7 @@ public class Notification implements Parcelable
            }
            }


            RemoteViews header = makeNotificationHeader();
            RemoteViews header = makeNotificationHeader();

            header.setBoolean(R.id.notification_header, "setAcceptAllTouches", true);
            if (summary != null) {
            if (summary != null) {
                mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary);
                mN.extras.putCharSequence(EXTRA_SUB_TEXT, summary);
            } else {
            } else {
+11 −2
Original line number Original line Diff line number Diff line
@@ -94,6 +94,7 @@ public class NotificationHeaderView extends ViewGroup {
            }
            }
        }
        }
    };
    };
    private boolean mAcceptAllTouches;


    public NotificationHeaderView(Context context) {
    public NotificationHeaderView(Context context) {
        this(context, null);
        this(context, null);
@@ -374,6 +375,8 @@ public class NotificationHeaderView extends ViewGroup {
                case MotionEvent.ACTION_DOWN:
                case MotionEvent.ACTION_DOWN:
                    mTrackGesture = false;
                    mTrackGesture = false;
                    if (isInside(x, y)) {
                    if (isInside(x, y)) {
                        mDownX = x;
                        mDownY = y;
                        mTrackGesture = true;
                        mTrackGesture = true;
                        return true;
                        return true;
                    }
                    }
@@ -396,11 +399,12 @@ public class NotificationHeaderView extends ViewGroup {
        }
        }


        private boolean isInside(float x, float y) {
        private boolean isInside(float x, float y) {
            if (mAcceptAllTouches) {
                return true;
            }
            for (int i = 0; i < mTouchRects.size(); i++) {
            for (int i = 0; i < mTouchRects.size(); i++) {
                Rect r = mTouchRects.get(i);
                Rect r = mTouchRects.get(i);
                if (r.contains((int) x, (int) y)) {
                if (r.contains((int) x, (int) y)) {
                    mDownX = x;
                    mDownY = y;
                    return true;
                    return true;
                }
                }
            }
            }
@@ -433,4 +437,9 @@ public class NotificationHeaderView extends ViewGroup {
        }
        }
        return mTouchListener.isInside(x, y);
        return mTouchListener.isInside(x, y);
    }
    }

    @RemotableViewMethod
    public void setAcceptAllTouches(boolean acceptAllTouches) {
        mAcceptAllTouches = acceptAllTouches;
    }
}
}
+0 −7
Original line number Original line Diff line number Diff line
@@ -42,13 +42,6 @@ public class SystemBars extends SystemUI {
        createStatusBarFromConfig();
        createStatusBarFromConfig();
    }
    }


    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        if (mStatusBar != null) {
            mStatusBar.onConfigurationChanged(newConfig);
        }
    }

    @Override
    @Override
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (mStatusBar != null) {
        if (mStatusBar != null) {
+13 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,8 @@ import com.android.systemui.statusbar.stack.ViewState;
 * A notification shelf view that is placed inside the notification scroller. It manages the
 * A notification shelf view that is placed inside the notification scroller. It manages the
 * overflow icons that don't fit into the regular list anymore.
 * overflow icons that don't fit into the regular list anymore.
 */
 */
public class NotificationShelf extends ActivatableNotificationView {
public class NotificationShelf extends ActivatableNotificationView implements
        View.OnLayoutChangeListener {


    public static final boolean SHOW_AMBIENT_ICONS = true;
    public static final boolean SHOW_AMBIENT_ICONS = true;
    private static final boolean USE_ANIMATIONS_WHEN_OPENING =
    private static final boolean USE_ANIMATIONS_WHEN_OPENING =
@@ -494,6 +495,10 @@ public class NotificationShelf extends ActivatableNotificationView {
    @Override
    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        super.onLayout(changed, left, top, right, bottom);
        updateRelativeOffset();
    }

    private void updateRelativeOffset() {
        mCollapsedIcons.getLocationOnScreen(mTmp);
        mCollapsedIcons.getLocationOnScreen(mTmp);
        mRelativeOffset = mTmp[0];
        mRelativeOffset = mTmp[0];
        getLocationOnScreen(mTmp);
        getLocationOnScreen(mTmp);
@@ -560,6 +565,7 @@ public class NotificationShelf extends ActivatableNotificationView {


    public void setCollapsedIcons(NotificationIconContainer collapsedIcons) {
    public void setCollapsedIcons(NotificationIconContainer collapsedIcons) {
        mCollapsedIcons = collapsedIcons;
        mCollapsedIcons = collapsedIcons;
        mCollapsedIcons.addOnLayoutChangeListener(this);
    }
    }


    public void setStatusBarState(int statusBarState) {
    public void setStatusBarState(int statusBarState) {
@@ -595,6 +601,12 @@ public class NotificationShelf extends ActivatableNotificationView {
        }
        }
    }
    }


    @Override
    public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
            int oldTop, int oldRight, int oldBottom) {
        updateRelativeOffset();
    }

    private class ShelfState extends ExpandableViewState {
    private class ShelfState extends ExpandableViewState {
        private float openedAmount;
        private float openedAmount;
        private boolean hasItemsInStableShelf;
        private boolean hasItemsInStableShelf;
+8 −4
Original line number Original line Diff line number Diff line
@@ -612,9 +612,11 @@ public class StatusBarIconView extends AnimatedImageView {
    }
    }


    public void setIconAppearAmount(float iconAppearAmount) {
    public void setIconAppearAmount(float iconAppearAmount) {
        if (mIconAppearAmount != iconAppearAmount) {
            mIconAppearAmount = iconAppearAmount;
            mIconAppearAmount = iconAppearAmount;
            invalidate();
            invalidate();
        }
        }
    }


    public float getIconAppearAmount() {
    public float getIconAppearAmount() {
        return mIconAppearAmount;
        return mIconAppearAmount;
@@ -625,9 +627,11 @@ public class StatusBarIconView extends AnimatedImageView {
    }
    }


    public void setDotAppearAmount(float dotAppearAmount) {
    public void setDotAppearAmount(float dotAppearAmount) {
        if (mDotAppearAmount != dotAppearAmount) {
            mDotAppearAmount = dotAppearAmount;
            mDotAppearAmount = dotAppearAmount;
            invalidate();
            invalidate();
        }
        }
    }


    @Override
    @Override
    public void setVisibility(int visibility) {
    public void setVisibility(int visibility) {
Loading