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

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

Merge changes I6e5dc836,Ia0c663f0,I97eb6e79,I8a4a0213,I87798da9, ... into nyc-dev

* changes:
  Removed the group expand button
  Removed the bundle number from the header
  Fixed a crash with notification children
  Fixed a bug where the media header wasn't indented
  Fixed fading and dozemode for custom notifications
  Fixed a group bug with a single expanded child
  Fixed a bug where the top child notification wasn't expandable
  Fixed a bug where heads up where not expandable by touch
  Fixed a bug where the wallpaper was shining through the background
parents 5b6c9823 6db57580
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -2994,7 +2994,6 @@ public class Notification implements Parcelable
            contentView.setViewVisibility(R.id.chronometer, View.GONE);
            contentView.setViewVisibility(R.id.header_sub_text, View.GONE);
            contentView.setViewVisibility(R.id.header_content_info, View.GONE);
            contentView.setViewVisibility(R.id.number_of_children, View.GONE);
            contentView.setViewVisibility(R.id.sub_text_divider, View.GONE);
            contentView.setViewVisibility(R.id.content_info_divider, View.GONE);
            contentView.setViewVisibility(R.id.time_divider, View.GONE);
@@ -3095,7 +3094,6 @@ public class Notification implements Parcelable

        private void bindNotificationHeader(RemoteViews contentView) {
            bindSmallIcon(contentView);
            bindChildCountColor(contentView);
            bindHeaderAppName(contentView);
            bindHeaderSubText(contentView);
            bindContentInfo(contentView);
@@ -3104,10 +3102,6 @@ public class Notification implements Parcelable
            bindProfileBadge(contentView);
        }

        private void bindChildCountColor(RemoteViews contentView) {
            contentView.setTextColor(R.id.number_of_children, resolveColor());
        }

        private void bindContentInfo(RemoteViews contentView) {
            boolean visible = false;
            if (mN.extras.getCharSequence(EXTRA_INFO_TEXT) != null) {
+3 −35
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ import java.util.ArrayList;
public class NotificationHeaderView extends ViewGroup {
    public static final int NO_COLOR = -1;
    private final int mChildMinWidth;
    private final int mExpandTopPadding;
    private final int mContentEndMargin;
    private View mAppName;
    private View mSubTextView;
@@ -43,12 +42,10 @@ public class NotificationHeaderView extends ViewGroup {
    private HeaderTouchListener mTouchListener = new HeaderTouchListener();
    private ImageView mExpandButton;
    private View mIcon;
    private TextView mChildCount;
    private View mProfileBadge;
    private View mInfo;
    private int mIconColor;
    private int mOriginalNotificationColor;
    private boolean mGroupHeader;
    private boolean mExpanded;
    private boolean mShowWorkBadgeAtEnd;

@@ -70,7 +67,6 @@ public class NotificationHeaderView extends ViewGroup {
                com.android.internal.R.dimen.notification_header_shrink_min_width);
        mContentEndMargin = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.notification_content_margin_end);
        mExpandTopPadding = (int) (1 * getResources().getDisplayMetrics().density);
    }

    @Override
@@ -80,7 +76,6 @@ public class NotificationHeaderView extends ViewGroup {
        mSubTextView = findViewById(com.android.internal.R.id.header_sub_text);
        mExpandButton = (ImageView) findViewById(com.android.internal.R.id.expand_button);
        mIcon = findViewById(com.android.internal.R.id.icon);
        mChildCount = (TextView) findViewById(com.android.internal.R.id.number_of_children);
        mProfileBadge = findViewById(com.android.internal.R.id.profile_badge);
        mInfo = findViewById(com.android.internal.R.id.header_content_info);
    }
@@ -193,17 +188,6 @@ public class NotificationHeaderView extends ViewGroup {
        updateTouchListener();
    }

    public void setChildCount(int childCount) {
        if (childCount > 0) {
            mChildCount.setText(getContext().getString(
                    com.android.internal.R.string.notification_children_count_bracketed,
                    childCount));
            mChildCount.setVisibility(VISIBLE);
        } else {
            mChildCount.setVisibility(GONE);
        }
    }

    @RemotableViewMethod
    public void setOriginalIconColor(int color) {
        mIconColor = color;
@@ -222,11 +206,6 @@ public class NotificationHeaderView extends ViewGroup {
        return mOriginalNotificationColor;
    }

    public void setIsGroupHeader(boolean isGroupHeader) {
        mGroupHeader = isGroupHeader;
        updateExpandButton();
    }

    @RemotableViewMethod
    public void setExpanded(boolean expanded) {
        mExpanded = expanded;
@@ -235,24 +214,13 @@ public class NotificationHeaderView extends ViewGroup {

    private void updateExpandButton() {
        int drawableId;
        int paddingTop = 0;
        if (mGroupHeader) {
            if (mExpanded) {
                drawableId = com.android.internal.R.drawable.ic_collapse_bundle;
            } else {
                drawableId =com.android.internal.R.drawable.ic_expand_bundle;
            }
        } else {
        if (mExpanded) {
            drawableId = com.android.internal.R.drawable.ic_collapse_notification;
        } else {
            drawableId = com.android.internal.R.drawable.ic_expand_notification;
        }
            paddingTop = mExpandTopPadding;
        }
        mExpandButton.setImageDrawable(getContext().getDrawable(drawableId));
        mExpandButton.setColorFilter(mOriginalNotificationColor);
        mExpandButton.setPadding(0, paddingTop, 0, 0);
    }

    public void setShowWorkBadgeAtEnd(boolean showWorkBadgeAtEnd) {
+27 −13
Original line number Diff line number Diff line
@@ -89,36 +89,50 @@ public class MediaNotificationView extends FrameLayout {
        int topMargin = getMeasuredHeight() - mRightIcon.getMeasuredHeight()
                - iconParams.bottomMargin;
        // If the topMargin is high enough we can also remove the header constraint!
        boolean reMeasure = false;
        if (!hasIcon || topMargin >= mImageMinTopMargin) {
            resetHeaderIndention();
            reMeasure = resetHeaderIndention();
        } else {
            int paddingEnd = mNotificationContentImageMarginEnd;
            ViewGroup.MarginLayoutParams headerParams =
                    (MarginLayoutParams) mHeader.getLayoutParams();
            headerParams.setMarginEnd(mRightIcon.getMeasuredWidth() + iconParams.getMarginEnd());
            int newMarginEnd = mRightIcon.getMeasuredWidth() + iconParams.getMarginEnd();
            if (headerParams.getMarginEnd() != newMarginEnd) {
                headerParams.setMarginEnd(newMarginEnd);
                mHeader.setLayoutParams(headerParams);
                reMeasure = true;
            }
            if (mHeader.getPaddingEnd() != paddingEnd) {
                mHeader.setPadding(
                        isLayoutRtl() ? paddingEnd : mHeader.getPaddingLeft(),
                mHeader.setPaddingRelative(mHeader.getPaddingStart(),
                        mHeader.getPaddingTop(),
                        isLayoutRtl() ? mHeader.getPaddingLeft() : paddingEnd,
                        paddingEnd,
                        mHeader.getPaddingBottom());
                mHeader.setLayoutParams(headerParams);
                reMeasure = true;
            }
        }
        if (reMeasure) {
            measureChildWithMargins(mHeader, widthMeasureSpec, 0, heightMeasureSpec, 0);
        }
    }

    private void resetHeaderIndention() {
    private boolean resetHeaderIndention() {
        boolean remeasure = false;
        if (mHeader.getPaddingEnd() != mNotificationContentMarginEnd) {
            mHeader.setPaddingRelative(mHeader.getPaddingStart(),
                    mHeader.getPaddingTop(),
                    mNotificationContentMarginEnd,
                    mHeader.getPaddingBottom());
            remeasure = true;
        }
        ViewGroup.MarginLayoutParams headerParams =
                (MarginLayoutParams) mHeader.getLayoutParams();
        headerParams.setMarginEnd(0);
            mHeader.setPadding(
                    isLayoutRtl() ? mNotificationContentMarginEnd : mHeader.getPaddingLeft(),
                    mHeader.getPaddingTop(),
                    isLayoutRtl() ? mHeader.getPaddingLeft() : mNotificationContentMarginEnd,
                    mHeader.getPaddingBottom());
        if (headerParams.getMarginEnd() != 0) {
            headerParams.setMarginEnd(0);
            mHeader.setLayoutParams(headerParams);
            remeasure = true;
        }
        return remeasure;
    }

    public MediaNotificationView(Context context, AttributeSet attrs, int defStyleAttr,
+0 −10
Original line number Diff line number Diff line
@@ -32,16 +32,6 @@
        android:layout_height="18dp"
        android:layout_marginEnd="3dp"
        />
    <TextView
        android:id="@+id/number_of_children"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="@style/TextAppearance.Material.Notification"
        android:layout_marginEnd="3dp"
        android:layout_marginStart="2dp"
        android:visibility="gone"
        android:singleLine="true"
        />
    <TextView
        android:id="@+id/app_name_text"
        android:layout_width="wrap_content"
+0 −3
Original line number Diff line number Diff line
@@ -548,9 +548,6 @@
         [CHAR LIMIT=4] -->
    <string name="status_bar_notification_info_overflow">999+</string>

    <!-- The number of notifications in the notification header. An example would be (2) or (12) -->
    <string name="notification_children_count_bracketed">(<xliff:g id="notificationCount" example="1">%d</xliff:g>)</string>

    <!-- The divider symbol between different parts of the notification header. not translatable [CHAR LIMIT=1] -->
    <string name="notification_header_divider_symbol" translatable="false"></string>

Loading