mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Changing the widget loading strategy
Widget is loaded only when the user enters the overview mode and we keep the list updated as long as the user is in the overview mode. Once the user leaves the overview mode, we stop responding to widget updates Bug: 26077457 Change-Id: I9e4904b8f1300bfe0d77e2bc5f59aa6963fad8d1
This commit is contained in:
@@ -20,6 +20,7 @@ import android.app.Activity;
|
||||
import android.appwidget.AppWidgetHost;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.appwidget.AppWidgetProviderInfo;
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -28,7 +29,9 @@ import android.os.Bundle;
|
||||
import com.android.launcher3.IconCache;
|
||||
import com.android.launcher3.LauncherAppWidgetProviderInfo;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AppWidgetManagerCompat {
|
||||
@@ -62,6 +65,11 @@ public abstract class AppWidgetManagerCompat {
|
||||
return mAppWidgetManager.getAppWidgetInfo(appWidgetId);
|
||||
}
|
||||
|
||||
public LauncherAppWidgetProviderInfo getLauncherAppWidgetInfo(int appWidgetId) {
|
||||
AppWidgetProviderInfo info = getAppWidgetInfo(appWidgetId);
|
||||
return info == null ? null : LauncherAppWidgetProviderInfo.fromProviderInfo(mContext, info);
|
||||
}
|
||||
|
||||
public abstract List<AppWidgetProviderInfo> getAllProviders();
|
||||
|
||||
public abstract String loadLabel(LauncherAppWidgetProviderInfo info);
|
||||
@@ -81,4 +89,8 @@ public abstract class AppWidgetManagerCompat {
|
||||
public abstract Bitmap getBadgeBitmap(LauncherAppWidgetProviderInfo info, Bitmap bitmap,
|
||||
int imageWidth, int imageHeight);
|
||||
|
||||
public abstract LauncherAppWidgetProviderInfo findProvider(
|
||||
ComponentName provider, UserHandleCompat user);
|
||||
|
||||
public abstract HashMap<ComponentKey, AppWidgetProviderInfo> getAllProvidersMap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user