Search in sources :

Example 76 with Callbacks

use of com.android.launcher3.model.BgDataModel.Callbacks in project android_packages_apps_Launcher3 by AOSPA.

the class LauncherModelHelper method loadModelSync.

/**
 * Loads the model in memory synchronously
 */
public void loadModelSync() throws ExecutionException, InterruptedException {
    Callbacks mockCb = new Callbacks() {
    };
    Executors.MAIN_EXECUTOR.submit(() -> getModel().addCallbacksAndLoad(mockCb)).get();
    Executors.MODEL_EXECUTOR.submit(() -> {
    }).get();
    Executors.MAIN_EXECUTOR.submit(() -> {
    }).get();
    Executors.MAIN_EXECUTOR.submit(() -> getModel().removeCallbacks(mockCb)).get();
}
Also used : Callbacks(com.android.launcher3.model.BgDataModel.Callbacks)

Aggregations

Callbacks (com.android.launcher3.model.BgDataModel.Callbacks)39 ArrayList (java.util.ArrayList)22 IntArray (com.android.launcher3.util.IntArray)21 ItemInfo (com.android.launcher3.model.data.ItemInfo)18 LauncherAppWidgetInfo (com.android.launcher3.model.data.LauncherAppWidgetInfo)18 Nullable (androidx.annotation.Nullable)16 WorkspaceItemInfo (com.android.launcher3.model.data.WorkspaceItemInfo)13 AppInfo (com.android.launcher3.model.data.AppInfo)11 CallbackTask (com.android.launcher3.LauncherModel.CallbackTask)9 Animator (android.animation.Animator)8 AnimatorSet (android.animation.AnimatorSet)8 Intent (android.content.Intent)7 ApplicationInfo (android.content.pm.ApplicationInfo)7 LauncherActivityInfo (android.content.pm.LauncherActivityInfo)7 SessionInfo (android.content.pm.PackageInstaller.SessionInfo)7 PackageManager (android.content.pm.PackageManager)7 Rect (android.graphics.Rect)7 LauncherAppState (com.android.launcher3.LauncherAppState)7 LauncherModel (com.android.launcher3.LauncherModel)7 LoaderResults (com.android.launcher3.model.LoaderResults)7