Merge "Removed the summary line for notification groups" into nyc-dev
This commit is contained in:
@@ -397,9 +397,6 @@
|
||||
<!-- The padding on top of the first notification to the children container -->
|
||||
<dimen name="notification_children_container_top_padding">8dp</dimen>
|
||||
|
||||
<!-- The vertical distance from which the notification appear when children are expanded -->
|
||||
<dimen name="notification_appear_distance">140dp</dimen>
|
||||
|
||||
<!-- end margin for multi user switch in expanded quick settings -->
|
||||
<dimen name="multi_user_switch_expanded_margin">8dp</dimen>
|
||||
|
||||
|
||||
@@ -858,7 +858,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
||||
showing.setDark(dark, fade, delay);
|
||||
}
|
||||
if (mIsSummaryWithChildren) {
|
||||
mChildrenContainer.setDark(dark, fade, delay);
|
||||
mNotificationHeaderWrapper.setDark(dark, fade, delay);
|
||||
}
|
||||
}
|
||||
@@ -955,9 +954,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
||||
mIsSystemExpanded = expand;
|
||||
notifyHeightChanged(false /* needsAnimation */);
|
||||
logExpansionEvent(false, wasExpanded);
|
||||
if (mChildrenContainer != null) {
|
||||
mChildrenContainer.updateGroupOverflow();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,9 +966,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {
|
||||
mOnKeyguard = onKeyguard;
|
||||
logExpansionEvent(false, wasExpanded);
|
||||
if (wasExpanded != isExpanded()) {
|
||||
if (mIsSummaryWithChildren) {
|
||||
mChildrenContainer.updateGroupOverflow();
|
||||
}
|
||||
notifyHeightChanged(false /* needsAnimation */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,19 +18,10 @@ package com.android.systemui.statusbar.notification;
|
||||
|
||||
import android.app.Notification;
|
||||
import android.content.Context;
|
||||
import android.text.BidiFormatter;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.TextAppearanceSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.statusbar.ExpandableNotificationRow;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* A class managing {@link HybridNotificationView} views
|
||||
@@ -81,34 +72,4 @@ public class HybridNotificationViewManager {
|
||||
}
|
||||
return titleText;
|
||||
}
|
||||
|
||||
public HybridNotificationView bindFromNotificationGroup(
|
||||
HybridNotificationView reusableView,
|
||||
List<ExpandableNotificationRow> group, int startIndex) {
|
||||
if (reusableView == null) {
|
||||
reusableView = inflateHybridView();
|
||||
}
|
||||
SpannableStringBuilder summary = new SpannableStringBuilder();
|
||||
int childCount = group.size();
|
||||
for (int i = startIndex; i < childCount; i++) {
|
||||
ExpandableNotificationRow child = group.get(i);
|
||||
CharSequence titleText = resolveTitle(
|
||||
child.getStatusBarNotification().getNotification());
|
||||
if (titleText == null) {
|
||||
continue;
|
||||
}
|
||||
if (!TextUtils.isEmpty(summary)) {
|
||||
summary.append(mDivider,
|
||||
new TextAppearanceSpan(mContext, R.style.
|
||||
TextAppearance_Material_Notification_HybridNotificationDivider),
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
summary.append(BidiFormatter.getInstance().unicodeWrap(titleText));
|
||||
}
|
||||
// We want to force the same orientation as the layout RTL mode
|
||||
BidiFormatter formater = BidiFormatter.getInstance(
|
||||
reusableView.getLayoutDirection() == View.LAYOUT_DIRECTION_RTL);
|
||||
reusableView.bind(formater.unicodeWrap(summary));
|
||||
return reusableView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,19 +46,14 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
|
||||
private final List<View> mDividers = new ArrayList<>();
|
||||
private final List<ExpandableNotificationRow> mChildren = new ArrayList<>();
|
||||
private final HybridNotificationViewManager mHybridViewManager;
|
||||
private int mChildPadding;
|
||||
private int mDividerHeight;
|
||||
private int mMaxNotificationHeight;
|
||||
private int mNotificationHeaderHeight;
|
||||
private int mNotificationAppearDistance;
|
||||
private int mNotificatonTopPadding;
|
||||
private float mCollapsedBottompadding;
|
||||
private ViewInvertHelper mOverflowInvertHelper;
|
||||
private boolean mChildrenExpanded;
|
||||
private ExpandableNotificationRow mNotificationParent;
|
||||
private HybridNotificationView mGroupOverflowContainer;
|
||||
private ViewState mGroupOverFlowState;
|
||||
private int mRealHeight;
|
||||
private int mLayoutDirection = LAYOUT_DIRECTION_UNDEFINED;
|
||||
private boolean mUserLocked;
|
||||
@@ -80,7 +75,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
initDimens();
|
||||
mHybridViewManager = new HybridNotificationViewManager(getContext(), this);
|
||||
}
|
||||
|
||||
private void initDimens() {
|
||||
@@ -90,8 +84,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
R.dimen.notification_divider_height));
|
||||
mMaxNotificationHeight = getResources().getDimensionPixelSize(
|
||||
R.dimen.notification_max_height);
|
||||
mNotificationAppearDistance = getResources().getDimensionPixelSize(
|
||||
R.dimen.notification_appear_distance);
|
||||
mNotificationHeaderHeight = getResources().getDimensionPixelSize(
|
||||
com.android.internal.R.dimen.notification_content_margin_top);
|
||||
mNotificatonTopPadding = getResources().getDimensionPixelSize(
|
||||
@@ -111,10 +103,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
child.layout(0, 0, getWidth(), child.getMeasuredHeight());
|
||||
mDividers.get(i).layout(0, 0, getWidth(), mDividerHeight);
|
||||
}
|
||||
if (mGroupOverflowContainer != null) {
|
||||
mGroupOverflowContainer.layout(0, 0, getWidth(),
|
||||
mGroupOverflowContainer.getMeasuredHeight());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,9 +130,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
height += mDividerHeight;
|
||||
}
|
||||
int width = MeasureSpec.getSize(widthMeasureSpec);
|
||||
if (mGroupOverflowContainer != null) {
|
||||
mGroupOverflowContainer.measure(widthMeasureSpec, newHeightSpec);
|
||||
}
|
||||
mRealHeight = height;
|
||||
if (heightMode != MeasureSpec.UNSPECIFIED) {
|
||||
height = Math.min(height, size);
|
||||
@@ -173,8 +158,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
View divider = inflateDivider();
|
||||
addView(divider);
|
||||
mDividers.add(newIndex, divider);
|
||||
|
||||
updateGroupOverflow();
|
||||
}
|
||||
|
||||
public void removeNotification(ExpandableNotificationRow row) {
|
||||
@@ -194,31 +177,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
|
||||
row.setSystemChildExpanded(false);
|
||||
row.setUserLocked(false);
|
||||
updateGroupOverflow();
|
||||
}
|
||||
|
||||
public void updateGroupOverflow() {
|
||||
int childCount = mChildren.size();
|
||||
int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren(true /* likeCollapsed */);
|
||||
boolean hasOverflow = childCount > maxAllowedVisibleChildren;
|
||||
int lastVisibleIndex = hasOverflow ? maxAllowedVisibleChildren - 2
|
||||
: maxAllowedVisibleChildren - 1;
|
||||
if (hasOverflow) {
|
||||
mGroupOverflowContainer = mHybridViewManager.bindFromNotificationGroup(
|
||||
mGroupOverflowContainer, mChildren, lastVisibleIndex + 1);
|
||||
if (mOverflowInvertHelper == null) {
|
||||
mOverflowInvertHelper= new ViewInvertHelper(mGroupOverflowContainer,
|
||||
NotificationPanelView.DOZE_ANIMATION_DURATION);
|
||||
}
|
||||
if (mGroupOverFlowState == null) {
|
||||
mGroupOverFlowState = new ViewState();
|
||||
}
|
||||
} else if (mGroupOverflowContainer != null) {
|
||||
removeView(mGroupOverflowContainer);
|
||||
mGroupOverflowContainer = null;
|
||||
mOverflowInvertHelper = null;
|
||||
mGroupOverFlowState = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -226,7 +184,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
super.onConfigurationChanged(newConfig);
|
||||
int layoutDirection = getLayoutDirection();
|
||||
if (layoutDirection != mLayoutDirection) {
|
||||
updateGroupOverflow();
|
||||
mLayoutDirection = layoutDirection;
|
||||
}
|
||||
}
|
||||
@@ -346,11 +303,7 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
int yPosition = mNotificationHeaderHeight;
|
||||
boolean firstChild = true;
|
||||
int maxAllowedVisibleChildren = getMaxAllowedVisibleChildren();
|
||||
boolean hasOverflow = !mChildrenExpanded && childCount > maxAllowedVisibleChildren
|
||||
&& maxAllowedVisibleChildren != NUMBER_OF_CHILDREN_WHEN_CHILDREN_EXPANDED;
|
||||
int lastVisibleIndex = hasOverflow
|
||||
? maxAllowedVisibleChildren - 2
|
||||
: maxAllowedVisibleChildren - 1;
|
||||
int lastVisibleIndex = maxAllowedVisibleChildren - 1;
|
||||
float expandFactor = 0;
|
||||
if (mUserLocked) {
|
||||
expandFactor = getChildExpandFraction();
|
||||
@@ -391,15 +344,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
childState.location = parentState.location;
|
||||
yPosition += intrinsicHeight;
|
||||
}
|
||||
if (mGroupOverflowContainer != null) {
|
||||
mGroupOverFlowState.initFrom(mGroupOverflowContainer);
|
||||
if (hasOverflow) {
|
||||
StackViewState firstOverflowState =
|
||||
resultState.getViewStateForView(mChildren.get(lastVisibleIndex + 1));
|
||||
mGroupOverFlowState.yTranslation = firstOverflowState.yTranslation;
|
||||
}
|
||||
mGroupOverFlowState.alpha = mChildrenExpanded || !hasOverflow ? 0.0f : 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
private int getMaxAllowedVisibleChildren() {
|
||||
@@ -436,9 +380,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
tmpState.alpha = alpha;
|
||||
state.applyViewState(divider, tmpState);
|
||||
}
|
||||
if (mGroupOverflowContainer != null) {
|
||||
state.applyViewState(mGroupOverflowContainer, mGroupOverFlowState);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -473,10 +414,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
tmpState.alpha = alpha;
|
||||
stateAnimator.startViewAnimations(divider, tmpState, baseDelay, duration);
|
||||
}
|
||||
if (mGroupOverflowContainer != null) {
|
||||
stateAnimator.startViewAnimations(mGroupOverflowContainer, mGroupOverFlowState,
|
||||
baseDelay, duration);
|
||||
}
|
||||
}
|
||||
|
||||
public ExpandableNotificationRow getViewAtPosition(float y) {
|
||||
@@ -598,12 +535,6 @@ public class NotificationChildrenContainer extends ViewGroup {
|
||||
return minExpandHeight;
|
||||
}
|
||||
|
||||
public void setDark(boolean dark, boolean fade, long delay) {
|
||||
if (mGroupOverflowContainer != null) {
|
||||
mOverflowInvertHelper.setInverted(dark, fade, delay);
|
||||
}
|
||||
}
|
||||
|
||||
public void reInflateViews() {
|
||||
initDimens();
|
||||
for (int i = 0; i < mDividers.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user