Add support for system shortcuts in popup container
- Currently the system shortcuts are just widgets and app info - As shortcuts, they live in ShortcutsItemView - They are populated either as icons only (if there are deep shortcuts) or as icons + text - Widgets are disabled until binding them is complete (we request for them to be bound on long-press now). We should revisit this. Bug: 34940468 Change-Id: Ia51d002c3b3ede87658bdab57abfc3eeca1ed242
This commit is contained in:
1 parent
4a907d0f9d
commit
26b1746593
24 files changed
+491
-98
No files matched your search
@@ -91,11 +91,12 @@ public class WidgetPreviewLoader {
|
||||
* @return a request id which can be used to cancel the request.
|
||||
*/
|
||||
public CancellationSignal getPreview(WidgetItem item, int previewWidth,
|
||||
int previewHeight, WidgetCell caller) {
|
||||
int previewHeight, WidgetCell caller, boolean animate) {
|
||||
String size = previewWidth + "x" + previewHeight;
|
||||
WidgetCacheKey key = new WidgetCacheKey(item.componentName, item.user, size);
|
||||
|
||||
PreviewLoadTask task = new PreviewLoadTask(key, item, previewWidth, previewHeight, caller);
|
||||
PreviewLoadTask task = new PreviewLoadTask(key, item, previewWidth, previewHeight, caller,
|
||||
animate);
|
||||
task.executeOnExecutor(Utilities.THREAD_POOL_EXECUTOR);
|
||||
|
||||
CancellationSignal signal = new CancellationSignal();
|
||||
@@ -521,17 +522,19 @@ public class WidgetPreviewLoader {
|
||||
private final int mPreviewHeight;
|
||||
private final int mPreviewWidth;
|
||||
private final WidgetCell mCaller;
|
||||
private final boolean mAnimatePreviewIn;
|
||||
private final BaseActivity mActivity;
|
||||
@Thunk long[] mVersions;
|
||||
@Thunk Bitmap mBitmapToRecycle;
|
||||
|
||||
PreviewLoadTask(WidgetCacheKey key, WidgetItem info, int previewWidth,
|
||||
int previewHeight, WidgetCell caller) {
|
||||
int previewHeight, WidgetCell caller, boolean animate) {
|
||||
mKey = key;
|
||||
mInfo = info;
|
||||
mPreviewHeight = previewHeight;
|
||||
mPreviewWidth = previewWidth;
|
||||
mCaller = caller;
|
||||
mAnimatePreviewIn = animate;
|
||||
mActivity = BaseActivity.fromContext(mCaller.getContext());
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, String.format("%s, %s, %d, %d",
|
||||
@@ -587,7 +590,7 @@ public class WidgetPreviewLoader {
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(final Bitmap preview) {
|
||||
mCaller.applyPreview(preview);
|
||||
mCaller.applyPreview(preview, mAnimatePreviewIn);
|
||||
|
||||
// Write the generated preview to the DB in the worker thread
|
||||
if (mVersions != null) {
|
||||
|
||||
Reference in new issue
Block a user