Merge "Removing horizontal translation of shade for dual pane" into sc-dev am: 7a16dc9029
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13563292 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I8f4cc7ce8d6275c2fd9bdaa8eaa7fae42438e70d
This commit is contained in:
@@ -2926,7 +2926,8 @@ public class NotificationPanelViewController extends PanelViewController {
|
|||||||
* @param x the x-coordinate the touch event
|
* @param x the x-coordinate the touch event
|
||||||
*/
|
*/
|
||||||
protected void updateHorizontalPanelPosition(float x) {
|
protected void updateHorizontalPanelPosition(float x) {
|
||||||
if (mNotificationStackScrollLayoutController.getWidth() * 1.75f > mView.getWidth()) {
|
if (mNotificationStackScrollLayoutController.getWidth() * 1.75f > mView.getWidth()
|
||||||
|
|| Utils.shouldUseSplitNotificationShade(mFeatureFlags, mResources)) {
|
||||||
resetHorizontalPanelPosition();
|
resetHorizontalPanelPosition();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -451,9 +451,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllChildrenOfNotificationContainer_haveIds() {
|
public void testAllChildrenOfNotificationContainer_haveIds() {
|
||||||
when(mResources.getBoolean(R.bool.config_use_split_notification_shade)).thenReturn(true);
|
enableDualPaneShade();
|
||||||
when(mFeatureFlags.isTwoColumnNotificationShadeEnabled()).thenReturn(true);
|
|
||||||
|
|
||||||
mNotificationContainerParent.addView(newViewWithId(1));
|
mNotificationContainerParent.addView(newViewWithId(1));
|
||||||
mNotificationContainerParent.addView(newViewWithId(View.NO_ID));
|
mNotificationContainerParent.addView(newViewWithId(View.NO_ID));
|
||||||
|
|
||||||
@@ -482,8 +480,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSplitShadeLayout_isAlignedToGuideline() {
|
public void testSplitShadeLayout_isAlignedToGuideline() {
|
||||||
when(mResources.getBoolean(R.bool.config_use_split_notification_shade)).thenReturn(true);
|
enableDualPaneShade();
|
||||||
when(mFeatureFlags.isTwoColumnNotificationShadeEnabled()).thenReturn(true);
|
|
||||||
mNotificationContainerParent.addView(newViewWithId(R.id.qs_frame));
|
mNotificationContainerParent.addView(newViewWithId(R.id.qs_frame));
|
||||||
mNotificationContainerParent.addView(newViewWithId(R.id.notification_stack_scroller));
|
mNotificationContainerParent.addView(newViewWithId(R.id.notification_stack_scroller));
|
||||||
|
|
||||||
@@ -541,6 +538,23 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testOnDragDownEvent_horizontalTranslationIsZeroForDualPaneShade() {
|
||||||
|
when(mNotificationStackScrollLayoutController.getWidth()).thenReturn(350f);
|
||||||
|
when(mView.getWidth()).thenReturn(800);
|
||||||
|
enableDualPaneShade();
|
||||||
|
|
||||||
|
onTouchEvent(MotionEvent.obtain(0L, 0L, MotionEvent.ACTION_DOWN,
|
||||||
|
200f /* x position */, 0f, 0));
|
||||||
|
|
||||||
|
verify(mQsFrame).setTranslationX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void enableDualPaneShade() {
|
||||||
|
when(mResources.getBoolean(R.bool.config_use_split_notification_shade)).thenReturn(true);
|
||||||
|
when(mFeatureFlags.isTwoColumnNotificationShadeEnabled()).thenReturn(true);
|
||||||
|
}
|
||||||
|
|
||||||
private void onTouchEvent(MotionEvent ev) {
|
private void onTouchEvent(MotionEvent ev) {
|
||||||
mTouchHandler.onTouch(mView, ev);
|
mTouchHandler.onTouch(mView, ev);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user