Merge "Merge "Show selected bubble first, after stack expands" into rvc-dev am: 594cbe8241 am: 78c0ae9687" into rvc-d1-dev-plus-aosp am: 9bda9c2a14
Change-Id: Iae80753377e3a9a92c8dcd7200ca82a3715fa300
This commit is contained in:
@@ -549,6 +549,7 @@ public class BubbleData {
|
|||||||
Log.e(TAG, "Attempt to expand stack without selected bubble!");
|
Log.e(TAG, "Attempt to expand stack without selected bubble!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mSelectedBubble.markUpdatedAt(mTimeSource.currentTimeMillis());
|
||||||
mSelectedBubble.markAsAccessedAt(mTimeSource.currentTimeMillis());
|
mSelectedBubble.markAsAccessedAt(mTimeSource.currentTimeMillis());
|
||||||
mStateChange.orderChanged |= repackAll();
|
mStateChange.orderChanged |= repackAll();
|
||||||
} else if (!mBubbles.isEmpty()) {
|
} else if (!mBubbles.isEmpty()) {
|
||||||
@@ -662,7 +663,7 @@ public class BubbleData {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This applies a full sort and group pass to all existing bubbles. The bubbles are grouped
|
* This applies a full sort and group pass to all existing bubbles. The bubbles are grouped
|
||||||
* by groupId. Each group is then sorted by the max(lastUpdated) time of it's bubbles. Bubbles
|
* by groupId. Each group is then sorted by the max(lastUpdated) time of its bubbles. Bubbles
|
||||||
* within each group are then sorted by lastUpdated descending.
|
* within each group are then sorted by lastUpdated descending.
|
||||||
*
|
*
|
||||||
* @return true if the position of any bubbles changed as a result
|
* @return true if the position of any bubbles changed as a result
|
||||||
|
|||||||
@@ -599,13 +599,13 @@ public class BubbleDataTest extends SysuiTestCase {
|
|||||||
sendUpdatedEntryAtTime(mEntryA1, 1000);
|
sendUpdatedEntryAtTime(mEntryA1, 1000);
|
||||||
sendUpdatedEntryAtTime(mEntryA2, 2000);
|
sendUpdatedEntryAtTime(mEntryA2, 2000);
|
||||||
sendUpdatedEntryAtTime(mEntryB1, 3000); // [B1, A2, A1]
|
sendUpdatedEntryAtTime(mEntryB1, 3000); // [B1, A2, A1]
|
||||||
changeExpandedStateAtTime(true, 4000L);
|
changeExpandedStateAtTime(true, 4000L); // B1 marked updated at 4000L
|
||||||
mBubbleData.setListener(mListener);
|
mBubbleData.setListener(mListener);
|
||||||
|
|
||||||
// Test
|
// Test
|
||||||
sendUpdatedEntryAtTime(mEntryC1, 4000);
|
sendUpdatedEntryAtTime(mEntryC1, 4000);
|
||||||
verifyUpdateReceived();
|
verifyUpdateReceived();
|
||||||
assertOrderChangedTo(mBubbleC1, mBubbleB1, mBubbleA2, mBubbleA1);
|
assertOrderChangedTo(mBubbleB1, mBubbleC1, mBubbleA2, mBubbleA1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -789,8 +789,7 @@ public class BubbleDataTest extends SysuiTestCase {
|
|||||||
* When the stack transitions to the collapsed state, the selected bubble is brought to the top.
|
* When the stack transitions to the collapsed state, the selected bubble is brought to the top.
|
||||||
* Bubbles within the same group should move up with it.
|
* Bubbles within the same group should move up with it.
|
||||||
* <p>
|
* <p>
|
||||||
* When the stack transitions back to the expanded state, the previous ordering is restored, as
|
* When the stack transitions back to the expanded state, this new order is kept as is.
|
||||||
* long as no changes have been made (adds, removes or updates) while in the collapsed state.
|
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void test_expansionChanges() {
|
public void test_expansionChanges() {
|
||||||
@@ -813,20 +812,12 @@ public class BubbleDataTest extends SysuiTestCase {
|
|||||||
// stack is expanded. When next collapsed, sorting will be applied and saved, just prior
|
// stack is expanded. When next collapsed, sorting will be applied and saved, just prior
|
||||||
// to moving the selected bubble to the top (first).
|
// to moving the selected bubble to the top (first).
|
||||||
//
|
//
|
||||||
// In this case, the expected re-expand state will be: [B1, B2, A2*, A1]
|
// In this case, the expected re-expand state will be: [A2, A1, B1, B2]
|
||||||
//
|
|
||||||
// That state is restored as long as no changes occur (add/remove/update) while in
|
|
||||||
// the collapsed state.
|
|
||||||
//
|
//
|
||||||
// collapse -> selected bubble (A2) moves first.
|
// collapse -> selected bubble (A2) moves first.
|
||||||
changeExpandedStateAtTime(false, 8000L);
|
changeExpandedStateAtTime(false, 8000L);
|
||||||
verifyUpdateReceived();
|
verifyUpdateReceived();
|
||||||
assertOrderChangedTo(mBubbleA2, mBubbleA1, mBubbleB1, mBubbleB2);
|
assertOrderChangedTo(mBubbleA2, mBubbleA1, mBubbleB1, mBubbleB2);
|
||||||
|
|
||||||
// expand -> "original" order/grouping restored
|
|
||||||
changeExpandedStateAtTime(true, 10000L);
|
|
||||||
verifyUpdateReceived();
|
|
||||||
assertOrderChangedTo(mBubbleB1, mBubbleB2, mBubbleA2, mBubbleA1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user