diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 00ec4c2..c0c6673 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -526,19 +526,23 @@
      * Sets the icon for this view based on the layout direction.
      */
     @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
-    public void setIcon(Drawable icon) {
+    private void setIcon(Drawable icon) {
         mIcon = icon;
         if (mIconSize != -1) {
             mIcon.setBounds(0, 0, mIconSize, mIconSize);
         }
+        applyCompoundDrawables(mIcon);
+    }
+
+    protected void applyCompoundDrawables(Drawable icon) {
         if (mLayoutHorizontal) {
             if (Utilities.ATLEAST_JB_MR1) {
-                setCompoundDrawablesRelative(mIcon, null, null, null);
+                setCompoundDrawablesRelative(icon, null, null, null);
             } else {
-                setCompoundDrawables(mIcon, null, null, null);
+                setCompoundDrawables(icon, null, null, null);
             }
         } else {
-            setCompoundDrawables(null, mIcon, null, null);
+            setCompoundDrawables(null, icon, null, null);
         }
     }
 
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java
new file mode 100644
index 0000000..c48d160
--- /dev/null
+++ b/src/com/android/launcher3/shortcuts/DeepShortcutTextView.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.shortcuts;
+
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+
+import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.R;
+
+/**
+ * A {@link BubbleTextView} that has the shortcut icon on the left and drag handle on the right.
+ */
+public class DeepShortcutTextView extends BubbleTextView {
+
+    public DeepShortcutTextView(Context context) {
+        this(context, null, 0);
+    }
+
+    public DeepShortcutTextView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public DeepShortcutTextView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    /** Use the BubbleTextView icon for the start and the drag handle for the end. */
+    protected void applyCompoundDrawables(Drawable icon) {
+        Drawable dragHandle = getResources().getDrawable(R.drawable.deep_shortcuts_drag_handle);
+        dragHandle.setBounds(0, 0, dragHandle.getIntrinsicWidth(), dragHandle.getIntrinsicHeight());
+        setCompoundDrawablesRelative(icon, null, dragHandle, null);
+    }
+}
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
index 912f006..f91665f 100644
--- a/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
+++ b/src/com/android/launcher3/shortcuts/DeepShortcutsContainer.java
@@ -160,11 +160,10 @@
                     final ShortcutInfoCompat shortcut = shortcuts.get(i);
                     final ShortcutInfo launcherShortcutInfo = ShortcutInfo
                             .fromDeepShortcutInfo(shortcut, mLauncher);
-                    CharSequence label = shortcut.getLongLabel();
-                    if (TextUtils.isEmpty(label)) {
-                        label = shortcut.getShortLabel();
-                    }
-                    uiHandler.post(new UpdateShortcutChild(i, launcherShortcutInfo, label));
+                    CharSequence shortLabel = shortcut.getShortLabel();
+                    CharSequence longLabel = shortcut.getLongLabel();
+                    uiHandler.post(new UpdateShortcutChild(i, launcherShortcutInfo,
+                            shortLabel, longLabel));
                 }
             }
         });
@@ -174,13 +173,15 @@
     private class UpdateShortcutChild implements Runnable {
         private int mShortcutChildIndex;
         private ShortcutInfo mShortcutChildInfo;
-        private CharSequence mLabel;
+        private CharSequence mShortLabel;
+        private CharSequence mLongLabel;
 
         public UpdateShortcutChild(int shortcutChildIndex, ShortcutInfo shortcutChildInfo,
-                CharSequence label) {
+                CharSequence shortLabel, CharSequence longLabel) {
             mShortcutChildIndex = shortcutChildIndex;
             mShortcutChildInfo = shortcutChildInfo;
-            mLabel = label;
+            mShortLabel = shortLabel;
+            mLongLabel = longLabel;
         }
 
         @Override
@@ -188,7 +189,12 @@
             BubbleTextView shortcutView = getShortcutAt(mShortcutChildIndex).getBubbleText();
             shortcutView.applyFromShortcutInfo(mShortcutChildInfo,
                     LauncherAppState.getInstance().getIconCache());
-            shortcutView.setText(mLabel);
+            // Use the long label as long as it exists and fits.
+            int availableWidth = shortcutView.getWidth() - shortcutView.getTotalPaddingLeft()
+                    - shortcutView.getTotalPaddingRight();
+            boolean usingLongLabel = !TextUtils.isEmpty(mLongLabel)
+                    && shortcutView.getPaint().measureText(mLongLabel.toString()) <= availableWidth;
+            shortcutView.setText(usingLongLabel ? mLongLabel : mShortLabel);
             shortcutView.setOnClickListener(mLauncher);
             shortcutView.setOnLongClickListener(DeepShortcutsContainer.this);
             shortcutView.setOnTouchListener(DeepShortcutsContainer.this);
