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

Commit 7c9cac96 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge changes Ia9502056,I97dc60c4 into nyc-dev

am: 482c7da6

* commit '482c7da6':
  Fixed the group expand motion to better reflect the overflow
  Introduced a number indicating more children in a group
parents 2907327b 482c7da6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
    android:layout_height="wrap_content"
    android:paddingStart="@*android:dimen/notification_content_margin_start"
    android:paddingEnd="12dp"
    android:gravity="bottom">
    android:gravity="bottom|start">
    <TextView
        android:id="@+id/notification_title"
        android:layout_width="wrap_content"
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2016 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->
<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/notification_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="@*android:style/TextAppearance.Material.Notification"
    android:paddingEnd="@*android:dimen/notification_content_margin_end"
    android:gravity="end"
    android:singleLine="true"
    />
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -570,6 +570,9 @@
    <!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_clear_all">Clear all notifications.</string>

    <!-- The overflow indicator shown when a group has more notification inside the group than the visible ones. An example is "+ 3" [CHAR LIMIT=5] -->
    <string name="notification_group_overflow_indicator">+ <xliff:g id="number" example="3">%s</xliff:g></string>

    <!-- Content description of button in notification inspector for system settings relating to
         notifications from this application [CHAR LIMIT=NONE] -->
    <string name="status_bar_notification_inspect_item_title">Notification settings</string>
+35 −2
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ import android.widget.RemoteViews;

import com.android.systemui.R;
import com.android.systemui.classifier.FalsingManager;
import com.android.systemui.statusbar.notification.HybridNotificationView;
import com.android.systemui.statusbar.notification.NotificationViewWrapper;
import com.android.systemui.statusbar.phone.NotificationGroupManager;
import com.android.systemui.statusbar.policy.HeadsUpManager;
@@ -227,6 +228,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        updateClearability();
        if (mIsSummaryWithChildren) {
            recreateNotificationHeader();
            mChildrenContainer.onNotificationUpdated();
        }
        if (mIconAnimationRunning) {
            setIconAnimationRunning(true);
@@ -584,6 +586,29 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
        mPublicLayout.closeRemoteInput();
    }

    /**
     * Set by how much the single line view should be indented.
     */
    public void setSingleLineWidthIndention(int indention) {
        mPrivateLayout.setSingleLineWidthIndention(indention);
    }

    public int getNotificationColor() {
        int color = getStatusBarNotification().getNotification().color;
        if (color == Notification.COLOR_DEFAULT) {
            return mContext.getColor(com.android.internal.R.color.notification_icon_default_color);
        }
        return color;
    }

    public HybridNotificationView getSingleLineView() {
        return mPrivateLayout.getSingleLineView();
    }

    public boolean isOnKeyguard() {
        return mOnKeyguard;
    }

    public interface ExpansionLogger {
        public void logNotificationExpansion(String key, boolean userAction, boolean expanded);
    }
@@ -677,6 +702,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            public void onInflate(ViewStub stub, View inflated) {
                mChildrenContainer = (NotificationChildrenContainer) inflated;
                mChildrenContainer.setNotificationParent(ExpandableNotificationRow.this);
                mChildrenContainer.onNotificationUpdated();
                mTranslateableViews.add(mChildrenContainer);
            }
        });
@@ -858,6 +884,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            showing.setDark(dark, fade, delay);
        }
        if (mIsSummaryWithChildren) {
            mChildrenContainer.setDark(dark, fade, delay);
            mNotificationHeaderWrapper.setDark(dark, fade, delay);
        }
    }
@@ -954,6 +981,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            mIsSystemExpanded = expand;
            notifyHeightChanged(false /* needsAnimation */);
            logExpansionEvent(false, wasExpanded);
            if (mChildrenContainer != null) {
                mChildrenContainer.updateGroupOverflow();
            }
        }
    }

@@ -966,6 +996,9 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            mOnKeyguard = onKeyguard;
            logExpansionEvent(false, wasExpanded);
            if (wasExpanded != isExpanded()) {
                if (mIsSummaryWithChildren) {
                    mChildrenContainer.updateGroupOverflow();
                }
                notifyHeightChanged(false /* needsAnimation */);
            }
        }
@@ -1260,7 +1293,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
    @Override
    public int getMinExpandHeight() {
        if (mIsSummaryWithChildren && !mShowingPublic) {
            return mChildrenContainer.getMinExpandHeight(mOnKeyguard);
            return mChildrenContainer.getMinExpandHeight();
        }
        return getMinHeight();
    }
@@ -1347,7 +1380,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
            if (isGroupExpanded()) {
                return 1.0f;
            } else if (isUserLocked()) {
                return mChildrenContainer.getChildExpandFraction();
                return mChildrenContainer.getGroupExpandFraction();
            }
        }
        return 0.0f;
+30 −6
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ import android.widget.FrameLayout;

import com.android.systemui.R;
import com.android.systemui.statusbar.notification.HybridNotificationView;
import com.android.systemui.statusbar.notification.HybridNotificationViewManager;
import com.android.systemui.statusbar.notification.HybridGroupManager;
import com.android.systemui.statusbar.notification.NotificationCustomViewWrapper;
import com.android.systemui.statusbar.notification.NotificationUtils;
import com.android.systemui.statusbar.notification.NotificationViewWrapper;
@@ -75,7 +75,7 @@ public class NotificationContentView extends FrameLayout {
    private NotificationViewWrapper mContractedWrapper;
    private NotificationViewWrapper mExpandedWrapper;
    private NotificationViewWrapper mHeadsUpWrapper;
    private HybridNotificationViewManager mHybridViewManager;
    private HybridGroupManager mHybridGroupManager;
    private int mClipTopAmount;
    private int mContentHeight;
    private int mUnrestrictedContentHeight;
@@ -116,10 +116,11 @@ public class NotificationContentView extends FrameLayout {
    private ExpandableNotificationRow mContainingNotification;
    private int mTransformationStartVisibleType;
    private boolean mUserExpanding;
    private int mSingleLineWidthIndention;

    public NotificationContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mHybridViewManager = new HybridNotificationViewManager(getContext(), this);
        mHybridGroupManager = new HybridGroupManager(getContext(), this);
        mMinContractedHeight = getResources().getDimensionPixelSize(
                R.dimen.min_notification_layout_height);
        mNotificationContentMarginEnd = getResources().getDimensionPixelSize(
@@ -139,6 +140,7 @@ public class NotificationContentView extends FrameLayout {
        boolean hasFixedHeight = heightMode == MeasureSpec.EXACTLY;
        boolean isHeightLimited = heightMode == MeasureSpec.AT_MOST;
        int maxSize = Integer.MAX_VALUE;
        int width = MeasureSpec.getSize(widthMeasureSpec);
        if (hasFixedHeight || isHeightLimited) {
            maxSize = MeasureSpec.getSize(heightMeasureSpec);
        }
@@ -187,12 +189,18 @@ public class NotificationContentView extends FrameLayout {
            maxChildHeight = Math.max(maxChildHeight, mHeadsUpChild.getMeasuredHeight());
        }
        if (mSingleLineView != null) {
            mSingleLineView.measure(widthMeasureSpec,
            int singleLineWidthSpec = widthMeasureSpec;
            if (mSingleLineWidthIndention != 0
                    && MeasureSpec.getMode(widthMeasureSpec) != MeasureSpec.UNSPECIFIED) {
                singleLineWidthSpec = MeasureSpec.makeMeasureSpec(
                        width - mSingleLineWidthIndention + mSingleLineView.getPaddingEnd(),
                        MeasureSpec.AT_MOST);
            }
            mSingleLineView.measure(singleLineWidthSpec,
                    MeasureSpec.makeMeasureSpec(maxSize, MeasureSpec.AT_MOST));
            maxChildHeight = Math.max(maxChildHeight, mSingleLineView.getMeasuredHeight());
        }
        int ownHeight = Math.min(maxChildHeight, maxSize);
        int width = MeasureSpec.getSize(widthMeasureSpec);
        setMeasuredDimension(width, ownHeight);
    }

@@ -715,7 +723,7 @@ public class NotificationContentView extends FrameLayout {

    private void updateSingleLineView() {
        if (mIsChildInGroup) {
            mSingleLineView = mHybridViewManager.bindFromNotification(
            mSingleLineView = mHybridGroupManager.bindFromNotification(
                    mSingleLineView, mStatusBarNotification.getNotification());
        } else if (mSingleLineView != null) {
            removeView(mSingleLineView);
@@ -878,4 +886,20 @@ public class NotificationContentView extends FrameLayout {
            updateBackgroundColor(false);
        }
    }

    /**
     * Set by how much the single line view should be indented. Used when a overflow indicator is
     * present and only during measuring
     */
    public void setSingleLineWidthIndention(int singleLineWidthIndention) {
        if (singleLineWidthIndention != mSingleLineWidthIndention) {
            mSingleLineWidthIndention = singleLineWidthIndention;
            mContainingNotification.forceLayout();
            forceLayout();
        }
    }

    public HybridNotificationView getSingleLineView() {
        return mSingleLineView;
    }
}
Loading