mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 15:56:49 +00:00
Create return-to-home app widget animation
If an app has been most recently launched from an app widget, when swiped away, the app animates to the widget's position. This is done by attributing the app launch to the widget through the ActivityOptions's launch cookies, and using a FloatingWidgetView throughout the animation. Bug: 169042867 Test: manual Change-Id: I24c2623b5b3407504a4768b076849c47f73cbae0
This commit is contained in:
@@ -23,6 +23,7 @@ import android.util.Pair;
|
||||
import android.view.View;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.ActivityOptionsWrapper;
|
||||
import com.android.launcher3.widget.LauncherAppWidgetHostView;
|
||||
|
||||
@@ -49,6 +50,10 @@ class QuickstepInteractionHandler implements RemoteViews.InteractionHandler {
|
||||
Pair<Intent, ActivityOptions> options = remoteResponse.getLaunchOptions(hostView);
|
||||
ActivityOptionsWrapper activityOptions = mLauncher.getAppTransitionManager()
|
||||
.getActivityLaunchOptions(mLauncher, hostView);
|
||||
Object itemInfo = hostView.getTag();
|
||||
if (itemInfo instanceof ItemInfo) {
|
||||
mLauncher.addLaunchCookie((ItemInfo) itemInfo, activityOptions.options);
|
||||
}
|
||||
options = Pair.create(options.first, activityOptions.options);
|
||||
return RemoteViews.startPendingIntent(hostView, pendingIntent, options);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user