use of com.android.launcher3.icons.cache.HandlerRunnable in project android_packages_apps_404Launcher by P-404.
the class DatabaseWidgetPreviewLoader method loadPreview.
/**
* Generates the widget preview on {@link AsyncTask#THREAD_POOL_EXECUTOR}. Must be
* called on UI thread.
*
* @return a request id which can be used to cancel the request.
*/
@NonNull
public HandlerRunnable loadPreview(@NonNull WidgetItem item, @NonNull Size previewSize, @NonNull Consumer<Bitmap> callback) {
Handler handler = Executors.UI_HELPER_EXECUTOR.getHandler();
HandlerRunnable<Bitmap> request = new HandlerRunnable<>(handler, () -> generatePreview(item, previewSize.getWidth(), previewSize.getHeight()), MAIN_EXECUTOR, callback);
Utilities.postAsyncCallback(handler, request);
return request;
}
use of com.android.launcher3.icons.cache.HandlerRunnable in project android_packages_apps_Launcher3 by ArrowOS.
the class DatabaseWidgetPreviewLoader method loadPreview.
/**
* Generates the widget preview on {@link AsyncTask#THREAD_POOL_EXECUTOR}. Must be
* called on UI thread.
*
* @return a request id which can be used to cancel the request.
*/
@NonNull
public HandlerRunnable loadPreview(@NonNull WidgetItem item, @NonNull Size previewSize, @NonNull Consumer<Bitmap> callback) {
Handler handler = Executors.UI_HELPER_EXECUTOR.getHandler();
HandlerRunnable<Bitmap> request = new HandlerRunnable<>(handler, () -> generatePreview(item, previewSize.getWidth(), previewSize.getHeight()), MAIN_EXECUTOR, callback);
Utilities.postAsyncCallback(handler, request);
return request;
}
use of com.android.launcher3.icons.cache.HandlerRunnable in project android_packages_apps_Launcher3 by ProtonAOSP.
the class DatabaseWidgetPreviewLoader method loadPreview.
/**
* Generates the widget preview on {@link AsyncTask#THREAD_POOL_EXECUTOR}. Must be
* called on UI thread.
*
* @return a request id which can be used to cancel the request.
*/
@NonNull
public HandlerRunnable loadPreview(@NonNull WidgetItem item, @NonNull Size previewSize, @NonNull Consumer<Bitmap> callback) {
Handler handler = Executors.UI_HELPER_EXECUTOR.getHandler();
HandlerRunnable<Bitmap> request = new HandlerRunnable<>(handler, () -> generatePreview(item, previewSize.getWidth(), previewSize.getHeight()), MAIN_EXECUTOR, callback);
Utilities.postAsyncCallback(handler, request);
return request;
}
use of com.android.launcher3.icons.cache.HandlerRunnable in project android_packages_apps_Launcher3 by AOSPA.
the class DatabaseWidgetPreviewLoader method loadPreview.
/**
* Generates the widget preview on {@link AsyncTask#THREAD_POOL_EXECUTOR}. Must be
* called on UI thread.
*
* @return a request id which can be used to cancel the request.
*/
@NonNull
public HandlerRunnable loadPreview(@NonNull WidgetItem item, @NonNull Size previewSize, @NonNull Consumer<Bitmap> callback) {
Handler handler = Executors.UI_HELPER_EXECUTOR.getHandler();
HandlerRunnable<Bitmap> request = new HandlerRunnable<>(handler, () -> generatePreview(item, previewSize.getWidth(), previewSize.getHeight()), MAIN_EXECUTOR, callback);
Utilities.postAsyncCallback(handler, request);
return request;
}
Aggregations