mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Implement API to animate bubble bar position
Create a new API to animate bubble bar position. Animating it will not update its laid out location. To update bubble bar laid out location, BubbleBarUpdate can be used. Applying a location change from BubbleBarUpdate no longer animates the change. Bug: 330585402 Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT Test: long press bubble bar and drag it to left and right Change-Id: I2572da4c063fc8e07cf07c4303778d343baa4ec4
This commit is contained in:
@@ -419,9 +419,7 @@ public class BubbleBarController extends IBubblesListener.Stub {
|
||||
}
|
||||
if (update.bubbleBarLocation != null) {
|
||||
if (update.bubbleBarLocation != mBubbleBarViewController.getBubbleBarLocation()) {
|
||||
// Animate when receiving updates. Skip it if we received the initial state.
|
||||
boolean animate = !update.initialState;
|
||||
updateBubbleBarLocationInternal(update.bubbleBarLocation, animate);
|
||||
updateBubbleBarLocationInternal(update.bubbleBarLocation);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -483,15 +481,21 @@ public class BubbleBarController extends IBubblesListener.Stub {
|
||||
* Updates the value locally in Launcher and in WMShell.
|
||||
*/
|
||||
public void updateBubbleBarLocation(BubbleBarLocation location) {
|
||||
updateBubbleBarLocationInternal(location, false /* animate */);
|
||||
updateBubbleBarLocationInternal(location);
|
||||
mSystemUiProxy.setBubbleBarLocation(location);
|
||||
}
|
||||
|
||||
private void updateBubbleBarLocationInternal(BubbleBarLocation location, boolean animate) {
|
||||
mBubbleBarViewController.setBubbleBarLocation(location, animate);
|
||||
private void updateBubbleBarLocationInternal(BubbleBarLocation location) {
|
||||
mBubbleBarViewController.setBubbleBarLocation(location);
|
||||
mBubbleStashController.setBubbleBarLocation(location);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
|
||||
mMainExecutor.execute(
|
||||
() -> mBubbleBarViewController.animateBubbleBarLocation(bubbleBarLocation));
|
||||
}
|
||||
|
||||
//
|
||||
// Loading data for the bubbles
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user