diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 5a44460..8d34b7e 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -84,7 +84,7 @@
     private final float mBackgroundDimAmount;
 
     // HORIZONTAL ELLIPSIS "...", character for popup hint.
-    private static final String POPUP_HINT_CHAR = "\u2026";
+    private static final String POPUP_HINT_CHAR = "...";
 
     // Margin between the label and the icon on a key that has both of them.
     // Specified by the fraction of the key width.
diff --git a/java/src/com/android/inputmethod/latin/SuggestionsView.java b/java/src/com/android/inputmethod/latin/SuggestionsView.java
index fbb2773..d7e7d59 100644
--- a/java/src/com/android/inputmethod/latin/SuggestionsView.java
+++ b/java/src/com/android/inputmethod/latin/SuggestionsView.java
@@ -41,6 +41,7 @@
 import android.text.style.StyleSpan;
 import android.text.style.UnderlineSpan;
 import android.util.AttributeSet;
+import android.view.GestureDetector;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
@@ -173,7 +174,7 @@
         private final float mCenterSuggestionWeight;
         private final int mCenterSuggestionIndex;
         private final Drawable mMoreSuggestionsHint;
-        private static final String MORE_SUGGESTIONS_HINT = "\u2026";
+        private static final String MORE_SUGGESTIONS_HINT = "...";
 
         private static final CharacterStyle BOLD_SPAN = new StyleSpan(Typeface.BOLD);
         private static final CharacterStyle UNDERLINE_SPAN = new UnderlineSpan();
@@ -261,7 +262,7 @@
             paint.setTextSize(textSize);
             paint.setColor(color);
             final Rect bounds = new Rect();
-            paint.getTextBounds(MORE_SUGGESTIONS_HINT, 0, 1, bounds);
+            paint.getTextBounds(MORE_SUGGESTIONS_HINT, 0, MORE_SUGGESTIONS_HINT.length(), bounds);
             final int width = Math.round(bounds.width() + 0.5f);
             final int height = Math.round(bounds.height() + 0.5f);
             final Bitmap buffer = Bitmap.createBitmap(
@@ -547,6 +548,8 @@
         final Resources res = context.getResources();
         mMoreSuggestionsModalTolerance = res.getDimensionPixelOffset(
                 R.dimen.more_suggestions_modal_tolerance);
+        mMoreSuggestionsSlidingDetector = new GestureDetector(
+                context, mMoreSuggestionsSlidingListener);
     }
 
     private final View.OnTouchListener mMoreSuggestionsCanceller = new View.OnTouchListener() {
@@ -791,6 +794,10 @@
 
     @Override
     public boolean onLongClick(View view) {
+        return showMoreSuggestions();
+    }
+
+    private boolean showMoreSuggestions() {
         final SuggestionsViewParams params = mParams;
         if (params.mMoreSuggestionsAvailable) {
             final int stripWidth = getWidth();
@@ -814,9 +821,11 @@
             mMoreSuggestionsMode = MORE_SUGGESTIONS_CHECKING_MODAL_OR_SLIDING;
             mOriginX = mLastX;
             mOriginY = mLastY;
-            view.setPressed(false);
             mKeyboardView.dimEntireKeyboard(true);
             mKeyboardView.setOnTouchListener(mMoreSuggestionsCanceller);
+            for (int i = 0; i < params.mSuggestionsCountInStrip; i++) {
+                mWords.get(i).setPressed(false);
+            }
             return true;
         }
         return false;
@@ -832,6 +841,18 @@
     private int mOriginX;
     private int mOriginY;
     private final int mMoreSuggestionsModalTolerance;
+    private final GestureDetector mMoreSuggestionsSlidingDetector;
+    private final GestureDetector.OnGestureListener mMoreSuggestionsSlidingListener =
+            new GestureDetector.SimpleOnGestureListener() {
+        @Override
+        public boolean onScroll(MotionEvent down, MotionEvent me, float deltaX, float deltaY) {
+            final float dy = me.getY() - down.getY();
+            if (deltaY > 0 && dy < 0) {
+                return showMoreSuggestions();
+            }
+            return false;
+        }
+    };
 
     @Override
     public boolean dispatchTouchEvent(MotionEvent me) {
@@ -839,6 +860,9 @@
                 || mMoreSuggestionsMode == MORE_SUGGESTIONS_IN_MODAL_MODE) {
             mLastX = (int)me.getX();
             mLastY = (int)me.getY();
+            if (mMoreSuggestionsSlidingDetector.onTouchEvent(me)) {
+                return true;
+            }
             return super.dispatchTouchEvent(me);
         }
 
