diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
index 4063edc..5f05b48 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java
@@ -65,7 +65,7 @@
     public final int mPadding;
     public final int mDividerWidth;
     public final int mSuggestionsStripHeight;
-    public final int mSuggestionsCountInStrip;
+    private final int mSuggestionsCountInStrip;
     public final int mMoreSuggestionsRowHeight;
     private int mMaxMoreSuggestionsRow;
     public final float mMinMoreSuggestionsWidth;
@@ -288,54 +288,65 @@
         params.gravity = Gravity.CENTER;
     }
 
-    public void layout(final SuggestedWords suggestedWords, final ViewGroup stripView,
-            final ViewGroup placerView) {
+    /**
+     * Layout suggestions to the suggestions strip. And returns the number of suggestions displayed
+     * in the suggestions strip.
+     *
+     * @param suggestedWords suggestions to be shown in the suggestions strip.
+     * @param stripView the suggestions strip view.
+     * @param placerView the view where the debug info will be placed.
+     * @return the number of suggestions displayed in the suggestions strip
+     */
+    public int layoutAndReturnSuggestionCountInStrip(final SuggestedWords suggestedWords,
+            final ViewGroup stripView, final ViewGroup placerView) {
         if (suggestedWords.mIsPunctuationSuggestions) {
-            layoutPunctuationSuggestions(suggestedWords, stripView);
-            return;
+            return layoutPunctuationSuggestionsAndReturnSuggestionCountInStrip(
+                    suggestedWords, stripView);
         }
 
-        final int countInStrip = mSuggestionsCountInStrip;
-        setupWordViewsTextAndColor(suggestedWords, countInStrip);
+        setupWordViewsTextAndColor(suggestedWords, mSuggestionsCountInStrip);
         final TextView centerWordView = mWordViews.get(mCenterPositionInStrip);
         final int availableStripWidth = placerView.getWidth()
                 - placerView.getPaddingRight() - placerView.getPaddingLeft();
         final int centerWidth = getSuggestionWidth(mCenterPositionInStrip, availableStripWidth);
-        if (getTextScaleX(centerWordView.getText(), centerWidth, centerWordView.getPaint())
-                < MIN_TEXT_XSCALE) {
+        final int countInStrip;
+        if (suggestedWords.size() == 1 || getTextScaleX(centerWordView.getText(), centerWidth,
+                centerWordView.getPaint()) < MIN_TEXT_XSCALE) {
             // Layout only the most relevant suggested word at the center of the suggestion strip
             // by consolidating all slots in the strip.
-            mMoreSuggestionsAvailable = (suggestedWords.size() > 1);
+            countInStrip = 1;
+            mMoreSuggestionsAvailable = (suggestedWords.size() > countInStrip);
             layoutWord(mCenterPositionInStrip, availableStripWidth - mPadding);
             stripView.addView(centerWordView);
             setLayoutWeight(centerWordView, 1.0f, ViewGroup.LayoutParams.MATCH_PARENT);
             if (SuggestionStripView.DBG) {
                 layoutDebugInfo(mCenterPositionInStrip, placerView, availableStripWidth);
             }
-            return;
-        }
+        } else {
+            countInStrip = mSuggestionsCountInStrip;
+            mMoreSuggestionsAvailable = (suggestedWords.size() > countInStrip);
+            int x = 0;
+            for (int positionInStrip = 0; positionInStrip < countInStrip; positionInStrip++) {
+                if (positionInStrip != 0) {
+                    final View divider = mDividerViews.get(positionInStrip);
+                    // Add divider if this isn't the left most suggestion in suggestions strip.
+                    addDivider(stripView, divider);
+                    x += divider.getMeasuredWidth();
+                }
 
-        mMoreSuggestionsAvailable = (suggestedWords.size() > countInStrip);
-        int x = 0;
-        for (int positionInStrip = 0; positionInStrip < countInStrip; positionInStrip++) {
-            if (positionInStrip != 0) {
-                final View divider = mDividerViews.get(positionInStrip);
-                // Add divider if this isn't the left most suggestion in suggestions strip.
-                addDivider(stripView, divider);
-                x += divider.getMeasuredWidth();
-            }
+                final int width = getSuggestionWidth(positionInStrip, availableStripWidth);
+                final TextView wordView = layoutWord(positionInStrip, width);
+                stripView.addView(wordView);
+                setLayoutWeight(wordView, getSuggestionWeight(positionInStrip),
+                        ViewGroup.LayoutParams.MATCH_PARENT);
+                x += wordView.getMeasuredWidth();
 
-            final int width = getSuggestionWidth(positionInStrip, availableStripWidth);
-            final TextView wordView = layoutWord(positionInStrip, width);
-            stripView.addView(wordView);
-            setLayoutWeight(wordView, getSuggestionWeight(positionInStrip),
-                    ViewGroup.LayoutParams.MATCH_PARENT);
-            x += wordView.getMeasuredWidth();
-
-            if (SuggestionStripView.DBG) {
-                layoutDebugInfo(positionInStrip, placerView, x);
+                if (SuggestionStripView.DBG) {
+                    layoutDebugInfo(positionInStrip, placerView, x);
+                }
             }
         }
+        return countInStrip;
     }
 
     /**
@@ -435,8 +446,8 @@
         }
     }
 
-    private void layoutPunctuationSuggestions(final SuggestedWords suggestedWords,
-            final ViewGroup stripView) {
+    private int layoutPunctuationSuggestionsAndReturnSuggestionCountInStrip(
+            final SuggestedWords suggestedWords, final ViewGroup stripView) {
         final int countInStrip = Math.min(suggestedWords.size(), PUNCTUATIONS_IN_STRIP);
         for (int positionInStrip = 0; positionInStrip < countInStrip; positionInStrip++) {
             if (positionInStrip != 0) {
@@ -457,6 +468,7 @@
             setLayoutWeight(wordView, 1.0f, mSuggestionsStripHeight);
         }
         mMoreSuggestionsAvailable = (suggestedWords.size() > countInStrip);
+        return countInStrip;
     }
 
     public void layoutAddToDictionaryHint(final String word, final ViewGroup addToDictionaryStrip,
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index 68c891b..32d7d23 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -77,6 +77,7 @@
 
     Listener mListener;
     private SuggestedWords mSuggestedWords = SuggestedWords.EMPTY;
+    private int mSuggestionsCountInStrip;
 
     private final SuggestionStripLayoutHelper mLayoutHelper;
     private final StripVisibilityGroup mStripVisibilityGroup;
@@ -189,7 +190,8 @@
         clear();
         mStripVisibilityGroup.setLayoutDirection(isRtlLanguage);
         mSuggestedWords = suggestedWords;
-        mLayoutHelper.layout(mSuggestedWords, mSuggestionsStrip, this);
+        mSuggestionsCountInStrip = mLayoutHelper.layoutAndReturnSuggestionCountInStrip(
+                mSuggestedWords, mSuggestionsStrip, this);
         if (ProductionFlag.USES_DEVELOPMENT_ONLY_DIAGNOSTICS) {
             ResearchLogger.suggestionStripView_setSuggestions(mSuggestedWords);
         }
@@ -313,7 +315,7 @@
         final View container = mMoreSuggestionsContainer;
         final int maxWidth = stripWidth - container.getPaddingLeft() - container.getPaddingRight();
         final MoreSuggestions.Builder builder = mMoreSuggestionsBuilder;
-        builder.layout(mSuggestedWords, layoutHelper.mSuggestionsCountInStrip, maxWidth,
+        builder.layout(mSuggestedWords, mSuggestionsCountInStrip, maxWidth,
                 (int)(maxWidth * layoutHelper.mMinMoreSuggestionsWidth),
                 layoutHelper.getMaxMoreSuggestionsRow(), parentKeyboard);
         mMoreSuggestionsView.setKeyboard(builder.build());
@@ -327,7 +329,7 @@
         mMoreSuggestionsMode = MORE_SUGGESTIONS_CHECKING_MODAL_OR_SLIDING;
         mOriginX = mLastX;
         mOriginY = mLastY;
-        for (int i = 0; i < layoutHelper.mSuggestionsCountInStrip; i++) {
+        for (int i = 0; i < mSuggestionsCountInStrip; i++) {
             mWordViews.get(i).setPressed(false);
         }
         return true;
