mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Support Remote actions
Bug: 168846477 Test: Manual Change-Id: I7b9dc96bc7a8ccb25ccb4b7135880768256f1ef3
This commit is contained in:
@@ -65,6 +65,7 @@ import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.ItemInfoWithIcon;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.launcher3.model.data.PromiseAppInfo;
|
||||
import com.android.launcher3.model.data.RemoteActionItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.util.SafeCloseable;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
@@ -300,6 +301,14 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
verifyHighRes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply label and tag using a {@link RemoteActionItemInfo}
|
||||
*/
|
||||
public void applyFromRemoteActionInfo(RemoteActionItemInfo remoteActionItemInfo) {
|
||||
applyIconAndLabel(remoteActionItemInfo);
|
||||
setTag(remoteActionItemInfo);
|
||||
}
|
||||
|
||||
private void applyIconAndLabel(ItemInfoWithIcon info) {
|
||||
FastBitmapDrawable iconDrawable = newIcon(getContext(), info);
|
||||
mDotParams.color = IconPalette.getMutedColor(info.bitmap.color, 0.54f);
|
||||
@@ -681,6 +690,8 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
|
||||
mActivity.invalidateParent(info);
|
||||
} else if (info instanceof PackageItemInfo) {
|
||||
applyFromItemInfoWithIcon((PackageItemInfo) info);
|
||||
} else if (info instanceof RemoteActionItemInfo) {
|
||||
applyFromRemoteActionInfo((RemoteActionItemInfo) info);
|
||||
}
|
||||
|
||||
mDisableRelayout = false;
|
||||
|
||||
Reference in New Issue
Block a user