Handle other SystemShortcut view types.

Bug: 127807969
Change-Id: Ifcc24e9261ddc730bcddd5724a230910daafce17
This commit is contained in:
Jon Miranda
2019-03-13 08:18:44 -07:00
parent 6f064f9d3f
commit 87beed6404
2 changed files with 13 additions and 4 deletions

View File

@@ -50,6 +50,7 @@ import com.android.launcher3.folder.FolderShape;
import com.android.launcher3.graphics.ShiftedBitmapDrawable;
import com.android.launcher3.icons.LauncherIcons;
import com.android.launcher3.popup.SystemShortcut;
import com.android.launcher3.shortcuts.DeepShortcutView;
import androidx.annotation.Nullable;
import androidx.annotation.WorkerThread;
@@ -197,8 +198,14 @@ public class FloatingIconView extends View implements Animator.AnimatorListener,
// Similar to DragView, we simply use the BubbleTextView icon here.
drawable = ((BubbleTextView) v).getIcon();
}
if (v instanceof ImageView && info instanceof SystemShortcut) {
drawable = ((ImageView) v).getDrawable();
if (info instanceof SystemShortcut) {
if (v instanceof ImageView) {
drawable = ((ImageView) v).getDrawable();
} else if (v instanceof DeepShortcutView) {
drawable = ((DeepShortcutView) v).getIconView().getBackground();
} else {
drawable = v.getBackground();
}
}
if (drawable == null) {
drawable = Utilities.getFullDrawable(launcher, info, lp.width, lp.height,