Loading packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +7 −0 Original line number Diff line number Diff line Loading @@ -1486,6 +1486,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { updateBackground(); } public int getPositionOfChild(ExpandableNotificationRow childRow) { if (mIsSummaryWithChildren) { return mChildrenContainer.getPositionInLinearLayout(childRow); } return 0; } public void setExpansionLogger(ExpansionLogger logger, String key) { mLogger = logger; mLoggingKey = key; Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +8 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.stack.ScrollContainer; Loading Loading @@ -284,11 +285,17 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private void findScrollContainer() { if (mScrollContainer == null) { mScrollContainerChild = null; ViewParent p = this; while (p != null) { if (mScrollContainerChild == null && p instanceof ExpandableView) { mScrollContainerChild = (View) p; } if (p.getParent() instanceof ScrollContainer) { mScrollContainer = (ScrollContainer) p.getParent(); if (mScrollContainerChild == null) { mScrollContainerChild = (View) p; } break; } p = p.getParent(); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +23 −0 Original line number Diff line number Diff line Loading @@ -677,6 +677,10 @@ public class NotificationChildrenContainer extends ViewGroup { mHeaderUtil = new NotificationHeaderUtil(mNotificationParent); } public ExpandableNotificationRow getNotificationParent() { return mNotificationParent; } public NotificationHeaderView getHeaderView() { return mNotificationHeader; } Loading Loading @@ -854,4 +858,23 @@ public class NotificationChildrenContainer extends ViewGroup { child.setRemoved(); } } public int getPositionInLinearLayout(View childInGroup) { int position = mNotificationHeaderMargin + mNotificatonTopPadding; for (int i = 0; i < mChildren.size(); i++) { ExpandableNotificationRow child = mChildren.get(i); boolean notGone = child.getVisibility() != View.GONE; if (notGone) { position += mDividerHeight; } if (child == childInGroup) { return position; } if (notGone) { position += child.getIntrinsicHeight(); } } return 0; } } packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +28 −5 Original line number Diff line number Diff line Loading @@ -610,9 +610,13 @@ public class NotificationStackScrollLayout extends ViewGroup ExpandableView expandableView = (ExpandableView) mForcedScroll; int positionInLinearLayout = getPositionInLinearLayout(expandableView); int targetScroll = targetScrollForView(expandableView, positionInLinearLayout); int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight(); targetScroll = Math.max(0, Math.min(targetScroll, getScrollRange())); if (mOwnScrollY < targetScroll || positionInLinearLayout < mOwnScrollY) { // Only apply the scroll if we're scrolling the view upwards, or the view is so far up // that it is not visible anymore. if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) { mOwnScrollY = targetScroll; } } Loading Loading @@ -1032,9 +1036,13 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public boolean scrollTo(View v) { ExpandableView expandableView = (ExpandableView) v; int targetScroll = targetScrollForView(expandableView, getPositionInLinearLayout(v)); int positionInLinearLayout = getPositionInLinearLayout(v); int targetScroll = targetScrollForView(expandableView, positionInLinearLayout); int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight(); if (mOwnScrollY < targetScroll) { // Only apply the scroll if we're scrolling the view upwards, or the view is so far up // that it is not visible anymore. if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) { mScroller.startScroll(mScrollX, mOwnScrollY, 0, targetScroll - mOwnScrollY); mDontReportNextOverScroll = true; postInvalidateOnAnimation(); Loading Loading @@ -1062,6 +1070,10 @@ public class NotificationStackScrollLayout extends ViewGroup // animating away. To work around that we'll wait until things have settled. removeCallbacks(mReclamp); postDelayed(mReclamp, 50); } else if (mForcedScroll != null) { // The scroll was requested before we got the actual inset - in case we need // to scroll up some more do so now. scrollTo(mForcedScroll); } return insets; } Loading Loading @@ -2361,7 +2373,15 @@ public class NotificationStackScrollLayout extends ViewGroup return view.getHeight(); } private int getPositionInLinearLayout(View requestedChild) { private int getPositionInLinearLayout(View requestedView) { ExpandableNotificationRow childInGroup = null; ExpandableNotificationRow requestedRow = null; if (isChildInGroup(requestedView)) { // We're asking for a child in a group. Calculate the position of the parent first, // then within the parent. childInGroup = (ExpandableNotificationRow) requestedView; requestedView = requestedRow = childInGroup.getNotificationParent(); } int position = 0; float previousIncreasedAmount = 0.0f; for (int i = 0; i < getChildCount(); i++) { Loading @@ -2377,7 +2397,10 @@ public class NotificationStackScrollLayout extends ViewGroup } previousIncreasedAmount = increasedPaddingAmount; } if (child == requestedChild) { if (child == requestedView) { if (requestedRow != null) { position += requestedRow.getPositionOfChild(childInGroup); } return position; } if (notGone) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java +7 −0 Original line number Diff line number Diff line Loading @@ -1486,6 +1486,13 @@ public class ExpandableNotificationRow extends ActivatableNotificationView { updateBackground(); } public int getPositionOfChild(ExpandableNotificationRow childRow) { if (mIsSummaryWithChildren) { return mChildrenContainer.getPositionInLinearLayout(childRow); } return 0; } public void setExpansionLogger(ExpansionLogger logger, String key) { mLogger = logger; mLoggingKey = key; Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +8 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.statusbar.ExpandableView; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.stack.ScrollContainer; Loading Loading @@ -284,11 +285,17 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene private void findScrollContainer() { if (mScrollContainer == null) { mScrollContainerChild = null; ViewParent p = this; while (p != null) { if (mScrollContainerChild == null && p instanceof ExpandableView) { mScrollContainerChild = (View) p; } if (p.getParent() instanceof ScrollContainer) { mScrollContainer = (ScrollContainer) p.getParent(); if (mScrollContainerChild == null) { mScrollContainerChild = (View) p; } break; } p = p.getParent(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationChildrenContainer.java +23 −0 Original line number Diff line number Diff line Loading @@ -677,6 +677,10 @@ public class NotificationChildrenContainer extends ViewGroup { mHeaderUtil = new NotificationHeaderUtil(mNotificationParent); } public ExpandableNotificationRow getNotificationParent() { return mNotificationParent; } public NotificationHeaderView getHeaderView() { return mNotificationHeader; } Loading Loading @@ -854,4 +858,23 @@ public class NotificationChildrenContainer extends ViewGroup { child.setRemoved(); } } public int getPositionInLinearLayout(View childInGroup) { int position = mNotificationHeaderMargin + mNotificatonTopPadding; for (int i = 0; i < mChildren.size(); i++) { ExpandableNotificationRow child = mChildren.get(i); boolean notGone = child.getVisibility() != View.GONE; if (notGone) { position += mDividerHeight; } if (child == childInGroup) { return position; } if (notGone) { position += child.getIntrinsicHeight(); } } return 0; } }
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +28 −5 Original line number Diff line number Diff line Loading @@ -610,9 +610,13 @@ public class NotificationStackScrollLayout extends ViewGroup ExpandableView expandableView = (ExpandableView) mForcedScroll; int positionInLinearLayout = getPositionInLinearLayout(expandableView); int targetScroll = targetScrollForView(expandableView, positionInLinearLayout); int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight(); targetScroll = Math.max(0, Math.min(targetScroll, getScrollRange())); if (mOwnScrollY < targetScroll || positionInLinearLayout < mOwnScrollY) { // Only apply the scroll if we're scrolling the view upwards, or the view is so far up // that it is not visible anymore. if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) { mOwnScrollY = targetScroll; } } Loading Loading @@ -1032,9 +1036,13 @@ public class NotificationStackScrollLayout extends ViewGroup @Override public boolean scrollTo(View v) { ExpandableView expandableView = (ExpandableView) v; int targetScroll = targetScrollForView(expandableView, getPositionInLinearLayout(v)); int positionInLinearLayout = getPositionInLinearLayout(v); int targetScroll = targetScrollForView(expandableView, positionInLinearLayout); int outOfViewScroll = positionInLinearLayout + expandableView.getIntrinsicHeight(); if (mOwnScrollY < targetScroll) { // Only apply the scroll if we're scrolling the view upwards, or the view is so far up // that it is not visible anymore. if (mOwnScrollY < targetScroll || outOfViewScroll < mOwnScrollY) { mScroller.startScroll(mScrollX, mOwnScrollY, 0, targetScroll - mOwnScrollY); mDontReportNextOverScroll = true; postInvalidateOnAnimation(); Loading Loading @@ -1062,6 +1070,10 @@ public class NotificationStackScrollLayout extends ViewGroup // animating away. To work around that we'll wait until things have settled. removeCallbacks(mReclamp); postDelayed(mReclamp, 50); } else if (mForcedScroll != null) { // The scroll was requested before we got the actual inset - in case we need // to scroll up some more do so now. scrollTo(mForcedScroll); } return insets; } Loading Loading @@ -2361,7 +2373,15 @@ public class NotificationStackScrollLayout extends ViewGroup return view.getHeight(); } private int getPositionInLinearLayout(View requestedChild) { private int getPositionInLinearLayout(View requestedView) { ExpandableNotificationRow childInGroup = null; ExpandableNotificationRow requestedRow = null; if (isChildInGroup(requestedView)) { // We're asking for a child in a group. Calculate the position of the parent first, // then within the parent. childInGroup = (ExpandableNotificationRow) requestedView; requestedView = requestedRow = childInGroup.getNotificationParent(); } int position = 0; float previousIncreasedAmount = 0.0f; for (int i = 0; i < getChildCount(); i++) { Loading @@ -2377,7 +2397,10 @@ public class NotificationStackScrollLayout extends ViewGroup } previousIncreasedAmount = increasedPaddingAmount; } if (child == requestedChild) { if (child == requestedView) { if (requestedRow != null) { position += requestedRow.getPositionOfChild(childInGroup); } return position; } if (notGone) { Loading