mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Improving widget handling for pinItemRequest
> Preloading widget view while dragging for smoother transition > Skipping config activity and sending confirmation to the caller when widget is dropped Bug: 33584624 Change-Id: Ib23e5964298296d12d9c93f38aefdf924a07368e
This commit is contained in:
@@ -40,7 +40,7 @@ public class WidgetAddFlowHandler implements Parcelable {
|
||||
mProviderInfo = providerInfo;
|
||||
}
|
||||
|
||||
private WidgetAddFlowHandler(Parcel parcel) {
|
||||
protected WidgetAddFlowHandler(Parcel parcel) {
|
||||
mProviderInfo = AppWidgetProviderInfo.CREATOR.createFromParcel(parcel);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class WidgetAddFlowHandler implements Parcelable {
|
||||
*/
|
||||
public boolean startConfigActivity(Launcher launcher, int appWidgetId, ItemInfo info,
|
||||
int requestCode) {
|
||||
if (mProviderInfo.configure == null) {
|
||||
if (!needsConfigure()) {
|
||||
return false;
|
||||
}
|
||||
launcher.setWaitingForResult(PendingRequestArgs.forWidgetInfo(appWidgetId, this, info));
|
||||
@@ -91,6 +91,10 @@ public class WidgetAddFlowHandler implements Parcelable {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean needsConfigure() {
|
||||
return mProviderInfo.configure != null;
|
||||
}
|
||||
|
||||
public LauncherAppWidgetProviderInfo getProviderInfo(Context context) {
|
||||
return LauncherAppWidgetProviderInfo.fromProviderInfo(context, mProviderInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user