diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 63b9ed6..b7584d4 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -153,6 +153,10 @@
     private boolean mShowKeyPreviewPopup = true;
     private int mKeyPreviewLingerTimeout;
 
+    // Gesture floating preview text
+    // TODO: Make this parameter customizable by user via settings.
+    private int mGestureFloatingPreviewTextLingerTimeout;
+
     // Background state set
     private static final int[][][] KEY_PREVIEW_BACKGROUND_STATE_TABLE = {
         { // STATE_MIDDLE
@@ -204,6 +208,7 @@
 
     public static class DrawingHandler extends StaticInnerHandlerWrapper<KeyboardView> {
         private static final int MSG_DISMISS_KEY_PREVIEW = 0;
+        private static final int MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT = 1;
 
         public DrawingHandler(final KeyboardView outerInstance) {
             super(outerInstance);
@@ -221,6 +226,9 @@
                     previewText.setVisibility(INVISIBLE);
                 }
                 break;
+            case MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT:
+                keyboardView.mPreviewPlacerView.setGestureFloatingPreviewText(SuggestedWords.EMPTY);
+                break;
             }
         }
 
@@ -236,6 +244,10 @@
             removeMessages(MSG_DISMISS_KEY_PREVIEW);
         }
 
+        public void dismissGestureFloatingPreviewText(final long delay) {
+            sendMessageDelayed(obtainMessage(MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT), delay);
+        }
+
         public void cancelAllMessages() {
             cancelAllDismissKeyPreviews();
         }
@@ -279,6 +291,8 @@
                 R.styleable.KeyboardView_moreKeysLayout, 0);
         mBackgroundDimAlpha = keyboardViewAttr.getInt(
                 R.styleable.KeyboardView_backgroundDimAlpha, 0);
+        mGestureFloatingPreviewTextLingerTimeout = keyboardViewAttr.getInt(
+                R.styleable.KeyboardView_gestureFloatingPreviewTextLingerTimeout, 0);
         keyboardViewAttr.recycle();
 
         final TypedArray keyAttr = context.obtainStyledAttributes(attrs,
@@ -877,7 +891,7 @@
 
     public void dismissGestureFloatingPreviewText() {
         locatePreviewPlacerView();
-        mPreviewPlacerView.dismissGestureFloatingPreviewText();
+        mDrawingHandler.dismissGestureFloatingPreviewText(mGestureFloatingPreviewTextLingerTimeout);
     }
 
     @Override
diff --git a/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java b/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java
index 30ca859..aed23a4 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/GestureFloatingPreviewText.java
@@ -100,11 +100,7 @@
     }
 
     public void setSuggetedWords(final SuggestedWords suggestedWords) {
-        if (suggestedWords == null) {
-            mSuggestedWords = SuggestedWords.EMPTY;
-        } else {
-            mSuggestedWords = suggestedWords;
-        }
+        mSuggestedWords = suggestedWords;
         updatePreviewPosition();
     }
 
diff --git a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java
index a005dc9..bfb7b1f 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/PreviewPlacerView.java
@@ -41,6 +41,7 @@
 public final class PreviewPlacerView extends RelativeLayout {
     private final int[] mKeyboardViewOrigin = CoordinateUtils.newInstance();
 
+    // TODO: Consolidate gesture preview trail with {@link KeyboardView}
     private final SparseArray<GesturePreviewTrail> mGesturePreviewTrails =
             CollectionUtils.newSparseArray();
     private final Params mGesturePreviewTrailParams;
@@ -60,19 +61,16 @@
 
     private final DrawingHandler mDrawingHandler;
 
+    // TODO: Remove drawing handler.
     private static final class DrawingHandler extends StaticInnerHandlerWrapper<PreviewPlacerView> {
-        private static final int MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT = 0;
-        private static final int MSG_UPDATE_GESTURE_PREVIEW_TRAIL = 1;
+        private static final int MSG_UPDATE_GESTURE_PREVIEW_TRAIL = 0;
 
         private final Params mGesturePreviewTrailParams;
-        private final int mGestureFloatingPreviewTextLingerTimeout;
 
         public DrawingHandler(final PreviewPlacerView outerInstance,
-                final Params gesturePreviewTrailParams,
-                final int getstureFloatinPreviewTextLinerTimeout) {
+                final Params gesturePreviewTrailParams) {
             super(outerInstance);
             mGesturePreviewTrailParams = gesturePreviewTrailParams;
-            mGestureFloatingPreviewTextLingerTimeout = getstureFloatinPreviewTextLinerTimeout;
         }
 
         @Override
@@ -80,21 +78,12 @@
             final PreviewPlacerView placerView = getOuterInstance();
             if (placerView == null) return;
             switch (msg.what) {
-            case MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT:
-                placerView.setGestureFloatingPreviewText(null);
-                break;
             case MSG_UPDATE_GESTURE_PREVIEW_TRAIL:
                 placerView.invalidate();
                 break;
             }
         }
 
-        public void dismissGestureFloatingPreviewText() {
-            removeMessages(MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT);
-            sendMessageDelayed(obtainMessage(MSG_DISMISS_GESTURE_FLOATING_PREVIEW_TEXT),
-                    mGestureFloatingPreviewTextLingerTimeout);
-        }
-
         public void postUpdateGestureTrailPreview() {
             removeMessages(MSG_UPDATE_GESTURE_PREVIEW_TRAIL);
             sendMessageDelayed(obtainMessage(MSG_UPDATE_GESTURE_PREVIEW_TRAIL),
@@ -112,16 +101,13 @@
 
         final TypedArray keyboardViewAttr = context.obtainStyledAttributes(
                 attrs, R.styleable.KeyboardView, defStyle, R.style.KeyboardView);
-        final int gestureFloatingPreviewTextLingerTimeout = keyboardViewAttr.getInt(
-                R.styleable.KeyboardView_gestureFloatingPreviewTextLingerTimeout, 0);
         // TODO: mGestureFloatingPreviewText could be an instance of GestureFloatingPreviewText or
         // MultiGesturePreviewText, depending on the user's choice in the settings.
         mGestureFloatingPreviewText = new GestureFloatingPreviewText(keyboardViewAttr, context);
         mGesturePreviewTrailParams = new Params(keyboardViewAttr);
         keyboardViewAttr.recycle();
 
-        mDrawingHandler = new DrawingHandler(this, mGesturePreviewTrailParams,
-                gestureFloatingPreviewTextLingerTimeout);
+        mDrawingHandler = new DrawingHandler(this, mGesturePreviewTrailParams);
 
         final Paint gesturePaint = new Paint();
         gesturePaint.setAntiAlias(true);
@@ -285,10 +271,6 @@
         invalidate();
     }
 
-    public void dismissGestureFloatingPreviewText() {
-        mDrawingHandler.dismissGestureFloatingPreviewText();
-    }
-
     private void drawSlidingKeyInputPreview(final Canvas canvas) {
         // TODO: Implement rubber band preview
     }
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index f1f50fe..df733c5 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1588,10 +1588,9 @@
             final boolean dismissGestureFloatingPreviewText) {
         showSuggestionStrip(suggestedWords, null);
         final KeyboardView mainKeyboardView = mKeyboardSwitcher.getMainKeyboardView();
+        mainKeyboardView.showGestureFloatingPreviewText(suggestedWords);
         if (dismissGestureFloatingPreviewText) {
             mainKeyboardView.dismissGestureFloatingPreviewText();
-        } else {
-            mainKeyboardView.showGestureFloatingPreviewText(suggestedWords);
         }
     }
 
