diff --git a/java/res/values/keypress-vibration-durations.xml b/java/res/values/keypress-vibration-durations.xml
index 8f6b647..1d7e57b 100644
--- a/java/res/values/keypress-vibration-durations.xml
+++ b/java/res/values/keypress-vibration-durations.xml
@@ -23,5 +23,6 @@
         <item>herring,5</item>
         <item>tuna,5</item>
         <item>mako,20</item>
+        <item>manta,16</item>
     </string-array>
 </resources>
diff --git a/java/res/values/keypress-volumes.xml b/java/res/values/keypress-volumes.xml
index dd86d6c..d112069 100644
--- a/java/res/values/keypress-volumes.xml
+++ b/java/res/values/keypress-volumes.xml
@@ -25,5 +25,6 @@
         <item>stingray,0.4</item>
         <item>grouper,0.3</item>
         <item>mako,0.3</item>
+        <item>manta,0.2</item>
     </string-array>
 </resources>
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 87fb8ba..178c9ff 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -36,7 +36,6 @@
 import com.android.inputmethod.keyboard.internal.KeyStyles.KeyStyle;
 import com.android.inputmethod.keyboard.internal.KeyboardIconsSet;
 import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.ResourceUtils;
 import com.android.inputmethod.latin.StringUtils;
 
 import org.xmlpull.v1.XmlPullParser;
@@ -230,9 +229,9 @@
         mBackgroundType = style.getInt(keyAttr,
                 R.styleable.Keyboard_Key_backgroundType, row.getDefaultBackgroundType());
 
-        mVisualInsetsLeft = Math.round(ResourceUtils.getDimensionOrFraction(keyAttr,
+        mVisualInsetsLeft = Math.round(Keyboard.Builder.getDimensionOrFraction(keyAttr,
                 R.styleable.Keyboard_Key_visualInsetsLeft, params.mBaseWidth, 0));
-        mVisualInsetsRight = Math.round(ResourceUtils.getDimensionOrFraction(keyAttr,
+        mVisualInsetsRight = Math.round(Keyboard.Builder.getDimensionOrFraction(keyAttr,
                 R.styleable.Keyboard_Key_visualInsetsRight, params.mBaseWidth, 0));
         mIconId = KeySpecParser.getIconId(style.getString(keyAttr,
                 R.styleable.Keyboard_Key_keyIcon));
diff --git a/java/src/com/android/inputmethod/keyboard/Keyboard.java b/java/src/com/android/inputmethod/keyboard/Keyboard.java
index aa757f1..a5f9e9e 100644
--- a/java/src/com/android/inputmethod/keyboard/Keyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/Keyboard.java
@@ -39,7 +39,6 @@
 import com.android.inputmethod.latin.LocaleUtils.RunInLocale;
 import com.android.inputmethod.latin.R;
 import com.android.inputmethod.latin.ResourceUtils;
-import com.android.inputmethod.latin.StringUtils;
 import com.android.inputmethod.latin.SubtypeLocale;
 import com.android.inputmethod.latin.XmlParseUtils;
 
@@ -566,13 +565,13 @@
                 mParams = params;
                 TypedArray keyboardAttr = res.obtainAttributes(Xml.asAttributeSet(parser),
                         R.styleable.Keyboard);
-                mRowHeight = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                mRowHeight = (int)Builder.getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_rowHeight,
                         params.mBaseHeight, params.mDefaultRowHeight);
                 keyboardAttr.recycle();
                 TypedArray keyAttr = res.obtainAttributes(Xml.asAttributeSet(parser),
                         R.styleable.Keyboard_Key);
-                mDefaultKeyWidth = ResourceUtils.getDimensionOrFraction(keyAttr,
+                mDefaultKeyWidth = Builder.getDimensionOrFraction(keyAttr,
                         R.styleable.Keyboard_Key_keyWidth,
                         params.mBaseWidth, params.mDefaultKeyWidth);
                 mDefaultBackgroundType = keyAttr.getInt(R.styleable.Keyboard_Key_backgroundType,
@@ -625,7 +624,7 @@
                 final int keyboardRightEdge = mParams.mOccupiedWidth
                         - mParams.mHorizontalEdgesPadding;
                 if (keyAttr.hasValue(R.styleable.Keyboard_Key_keyXPos)) {
-                    final float keyXPos = ResourceUtils.getDimensionOrFraction(keyAttr,
+                    final float keyXPos = Builder.getDimensionOrFraction(keyAttr,
                             R.styleable.Keyboard_Key_keyXPos, mParams.mBaseWidth, 0);
                     if (keyXPos < 0) {
                         // If keyXPos is negative, the actual x-coordinate will be
@@ -646,7 +645,7 @@
             }
 
             public float getKeyWidth(TypedArray keyAttr, float keyXPos) {
-                final int widthType = ResourceUtils.getEnumValue(keyAttr,
+                final int widthType = Builder.getEnumValue(keyAttr,
                         R.styleable.Keyboard_Key_keyWidth, KEYWIDTH_NOT_ENUM);
                 switch (widthType) {
                 case KEYWIDTH_FILL_RIGHT:
@@ -656,7 +655,7 @@
                     // out the area up to the right edge of the keyboard.
                     return keyboardRightEdge - keyXPos;
                 default: // KEYWIDTH_NOT_ENUM
-                    return ResourceUtils.getDimensionOrFraction(keyAttr,
+                    return Builder.getDimensionOrFraction(keyAttr,
                             R.styleable.Keyboard_Key_keyWidth,
                             mParams.mBaseWidth, mDefaultKeyWidth);
                 }
@@ -769,14 +768,14 @@
                     keyboardHeight = keyboardAttr.getDimension(
                             R.styleable.Keyboard_keyboardHeight, displayHeight / 2);
                 }
-                final float maxKeyboardHeight = ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                final float maxKeyboardHeight = getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_maxKeyboardHeight, displayHeight, displayHeight / 2);
-                float minKeyboardHeight = ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                float minKeyboardHeight = getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_minKeyboardHeight, displayHeight, displayHeight / 2);
                 if (minKeyboardHeight < 0) {
                     // Specified fraction was negative, so it should be calculated against display
                     // width.
-                    minKeyboardHeight = -ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                    minKeyboardHeight = -getDimensionOrFraction(keyboardAttr,
                             R.styleable.Keyboard_minKeyboardHeight, displayWidth, displayWidth / 2);
                 }
                 final Params params = mParams;
@@ -785,27 +784,26 @@
                 params.mOccupiedHeight = (int)Math.max(
                         Math.min(keyboardHeight, maxKeyboardHeight), minKeyboardHeight);
                 params.mOccupiedWidth = params.mId.mWidth;
-                params.mTopPadding = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                params.mTopPadding = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_keyboardTopPadding, params.mOccupiedHeight, 0);
-                params.mBottomPadding = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                params.mBottomPadding = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_keyboardBottomPadding, params.mOccupiedHeight, 0);
-                params.mHorizontalEdgesPadding = (int)ResourceUtils.getDimensionOrFraction(
-                        keyboardAttr,
+                params.mHorizontalEdgesPadding = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_keyboardHorizontalEdgesPadding,
                         mParams.mOccupiedWidth, 0);
 
                 params.mBaseWidth = params.mOccupiedWidth - params.mHorizontalEdgesPadding * 2
                         - params.mHorizontalCenterPadding;
-                params.mDefaultKeyWidth = (int)ResourceUtils.getDimensionOrFraction(keyAttr,
+                params.mDefaultKeyWidth = (int)getDimensionOrFraction(keyAttr,
                         R.styleable.Keyboard_Key_keyWidth, params.mBaseWidth,
                         params.mBaseWidth / DEFAULT_KEYBOARD_COLUMNS);
-                params.mHorizontalGap = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                params.mHorizontalGap = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_horizontalGap, params.mBaseWidth, 0);
-                params.mVerticalGap = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                params.mVerticalGap = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_verticalGap, params.mOccupiedHeight, 0);
                 params.mBaseHeight = params.mOccupiedHeight - params.mTopPadding
                         - params.mBottomPadding + params.mVerticalGap;
-                params.mDefaultRowHeight = (int)ResourceUtils.getDimensionOrFraction(keyboardAttr,
+                params.mDefaultRowHeight = (int)getDimensionOrFraction(keyboardAttr,
                         R.styleable.Keyboard_rowHeight, params.mBaseHeight,
                         params.mBaseHeight / DEFAULT_KEYBOARD_ROWS);
 
@@ -1223,7 +1221,7 @@
             // If <case> does not have "index" attribute, that means this <case> is wild-card for
             // the attribute.
             return !a.hasValue(index)
-                    || StringUtils.containsInArray(value, a.getString(index).split("\\|"));
+                    || stringArrayContains(a.getString(index).split("\\|"), value);
         }
 
         private static boolean matchTypedValue(TypedArray a, int index, int intValue,
@@ -1234,10 +1232,19 @@
             if (v == null) {
                 return true;
             }
-            if (ResourceUtils.isIntegerValue(v)) {
+            if (isIntegerValue(v)) {
                 return intValue == a.getInt(index, 0);
-            } else if (ResourceUtils.isStringValue(v)) {
-                return StringUtils.containsInArray(strValue, a.getString(index).split("\\|"));
+            } else if (isStringValue(v)) {
+                return stringArrayContains(a.getString(index).split("\\|"), strValue);
+            }
+            return false;
+        }
+
+        private static boolean stringArrayContains(String[] array, String value) {
+            for (final String elem : array) {
+                if (elem.equals(value)) {
+                    return true;
+                }
             }
             return false;
         }
@@ -1327,6 +1334,47 @@
             mRightEdgeKey = null;
         }
 
+        public static float getDimensionOrFraction(TypedArray a, int index, int base,
+                float defValue) {
+            final TypedValue value = a.peekValue(index);
+            if (value == null) {
+                return defValue;
+            }
+            if (isFractionValue(value)) {
+                return a.getFraction(index, base, base, defValue);
+            } else if (isDimensionValue(value)) {
+                return a.getDimension(index, defValue);
+            }
+            return defValue;
+        }
+
+        public static int getEnumValue(TypedArray a, int index, int defValue) {
+            final TypedValue value = a.peekValue(index);
+            if (value == null) {
+                return defValue;
+            }
+            if (isIntegerValue(value)) {
+                return a.getInt(index, defValue);
+            }
+            return defValue;
+        }
+
+        private static boolean isFractionValue(TypedValue v) {
+            return v.type == TypedValue.TYPE_FRACTION;
+        }
+
+        private static boolean isDimensionValue(TypedValue v) {
+            return v.type == TypedValue.TYPE_DIMENSION;
+        }
+
+        private static boolean isIntegerValue(TypedValue v) {
+            return v.type >= TypedValue.TYPE_FIRST_INT && v.type <= TypedValue.TYPE_LAST_INT;
+        }
+
+        private static boolean isStringValue(TypedValue v) {
+            return v.type == TypedValue.TYPE_STRING;
+        }
+
         private static String textAttr(String value, String name) {
             return value != null ? String.format(" %s=%s", name, value) : "";
         }
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index d4d4ce7..a479709 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -43,7 +43,6 @@
 import com.android.inputmethod.latin.Constants;
 import com.android.inputmethod.latin.LatinImeLogger;
 import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.ResourceUtils;
 import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
 import com.android.inputmethod.latin.StringUtils;
 import com.android.inputmethod.latin.define.ProductionFlag;
@@ -85,6 +84,9 @@
 
     // Miscellaneous constants
     private static final int[] LONG_PRESSABLE_STATE_SET = { android.R.attr.state_long_pressable };
+    private static final float UNDEFINED_RATIO = -1.0f;
+    private static final int UNDEFINED_DIMENSION = -1;
+
     // XML attributes
     protected final float mVerticalCorrection;
     protected final int mMoreKeysLayout;
@@ -217,26 +219,20 @@
 
         public KeyDrawParams(final TypedArray a) {
             mKeyBackground = a.getDrawable(R.styleable.KeyboardView_keyBackground);
-            if (!ResourceUtils.isValidFraction(mKeyLetterRatio = ResourceUtils.getFraction(a,
+            if (!isValidFraction(mKeyLetterRatio = getFraction(a,
                     R.styleable.KeyboardView_keyLetterSize))) {
-                mKeyLetterSize = ResourceUtils.getDimensionPixelSize(a,
-                        R.styleable.KeyboardView_keyLetterSize);
+                mKeyLetterSize = getDimensionPixelSize(a, R.styleable.KeyboardView_keyLetterSize);
             }
-            if (!ResourceUtils.isValidFraction(mKeyLabelRatio = ResourceUtils.getFraction(a,
+            if (!isValidFraction(mKeyLabelRatio = getFraction(a,
                     R.styleable.KeyboardView_keyLabelSize))) {
-                mKeyLabelSize = ResourceUtils.getDimensionPixelSize(a,
-                        R.styleable.KeyboardView_keyLabelSize);
+                mKeyLabelSize = getDimensionPixelSize(a, R.styleable.KeyboardView_keyLabelSize);
             }
-            mKeyLargeLabelRatio = ResourceUtils.getFraction(a,
-                    R.styleable.KeyboardView_keyLargeLabelRatio);
-            mKeyLargeLetterRatio = ResourceUtils.getFraction(a,
-                    R.styleable.KeyboardView_keyLargeLetterRatio);
-            mKeyHintLetterRatio = ResourceUtils.getFraction(a,
-                    R.styleable.KeyboardView_keyHintLetterRatio);
-            mKeyShiftedLetterHintRatio = ResourceUtils.getFraction(a,
+            mKeyLargeLabelRatio = getFraction(a, R.styleable.KeyboardView_keyLargeLabelRatio);
+            mKeyLargeLetterRatio = getFraction(a, R.styleable.KeyboardView_keyLargeLetterRatio);
+            mKeyHintLetterRatio = getFraction(a, R.styleable.KeyboardView_keyHintLetterRatio);
+            mKeyShiftedLetterHintRatio = getFraction(a,
                     R.styleable.KeyboardView_keyShiftedLetterHintRatio);
-            mKeyHintLabelRatio = ResourceUtils.getFraction(a,
-                    R.styleable.KeyboardView_keyHintLabelRatio);
+            mKeyHintLabelRatio = getFraction(a, R.styleable.KeyboardView_keyHintLabelRatio);
             mKeyLabelHorizontalPadding = a.getDimension(
                     R.styleable.KeyboardView_keyLabelHorizontalPadding, 0);
             mKeyHintLetterPadding = a.getDimension(
@@ -267,10 +263,10 @@
             mKeyTypeface = (keyboard.mKeyTypeface != null)
                     ? keyboard.mKeyTypeface : mKeyTypefaceFromKeyboardView;
             final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
-            if (ResourceUtils.isValidFraction(mKeyLetterRatio)) {
+            if (isValidFraction(mKeyLetterRatio)) {
                 mKeyLetterSize = (int)(keyHeight * mKeyLetterRatio);
             }
-            if (ResourceUtils.isValidFraction(mKeyLabelRatio)) {
+            if (isValidFraction(mKeyLabelRatio)) {
                 mKeyLabelSize = (int)(keyHeight * mKeyLabelRatio);
             }
             mKeyLargeLabelSize = (int)(keyHeight * mKeyLargeLabelRatio);
@@ -345,15 +341,14 @@
                     R.styleable.KeyboardView_keyPreviewOffset, 0);
             mPreviewHeight = a.getDimensionPixelSize(
                     R.styleable.KeyboardView_keyPreviewHeight, 80);
-            mPreviewTextRatio = ResourceUtils.getFraction(a,
-                    R.styleable.KeyboardView_keyPreviewTextRatio);
+            mPreviewTextRatio = getFraction(a, R.styleable.KeyboardView_keyPreviewTextRatio);
             mPreviewTextColor = a.getColor(R.styleable.KeyboardView_keyPreviewTextColor, 0);
             mLingerTimeout = a.getInt(R.styleable.KeyboardView_keyPreviewLingerTimeout, 0);
         }
 
         public void updateParams(final Keyboard keyboard, final KeyDrawParams keyDrawParams) {
             final int keyHeight = keyboard.mMostCommonKeyHeight - keyboard.mVerticalGap;
-            if (ResourceUtils.isValidFraction(mPreviewTextRatio)) {
+            if (isValidFraction(mPreviewTextRatio)) {
                 mPreviewTextSize = (int)(keyHeight * mPreviewTextRatio);
             }
             mKeyLetterSize = keyDrawParams.mKeyLetterSize;
@@ -392,6 +387,26 @@
         mPaint.setAntiAlias(true);
     }
 
+    static boolean isValidFraction(final float fraction) {
+        return fraction >= 0.0f;
+    }
+
+    static float getFraction(final TypedArray a, final int index) {
+        final TypedValue value = a.peekValue(index);
+        if (value == null || value.type != TypedValue.TYPE_FRACTION) {
+            return UNDEFINED_RATIO;
+        }
+        return a.getFraction(index, 1, 1, UNDEFINED_RATIO);
+    }
+
+    public static int getDimensionPixelSize(final TypedArray a, final int index) {
+        final TypedValue value = a.peekValue(index);
+        if (value == null || value.type != TypedValue.TYPE_DIMENSION) {
+            return UNDEFINED_DIMENSION;
+        }
+        return a.getDimensionPixelSize(index, UNDEFINED_DIMENSION);
+    }
+
     /**
      * Attaches a keyboard to this view. The keyboard can be switched at any time and the
      * view will re-layout itself to accommodate the keyboard.
diff --git a/java/src/com/android/inputmethod/latin/ResourceUtils.java b/java/src/com/android/inputmethod/latin/ResourceUtils.java
index b3d7ac5..e01ac3d 100644
--- a/java/src/com/android/inputmethod/latin/ResourceUtils.java
+++ b/java/src/com/android/inputmethod/latin/ResourceUtils.java
@@ -17,16 +17,11 @@
 package com.android.inputmethod.latin;
 
 import android.content.res.Resources;
-import android.content.res.TypedArray;
 import android.os.Build;
-import android.util.TypedValue;
 
 import java.util.HashMap;
 
 public final class ResourceUtils {
-    public static final float UNDEFINED_RATIO = -1.0f;
-    public static final int UNDEFINED_DIMENSION = -1;
-
     private ResourceUtils() {
         // This utility class is not publicly instantiable.
     }
@@ -50,69 +45,4 @@
         }
         return sDeviceOverrideValueMap.get(key);
     }
-
-    public static boolean isValidFraction(final float fraction) {
-        return fraction >= 0.0f;
-    }
-
-    public static float getFraction(final TypedArray a, final int index, final float defValue) {
-        final TypedValue value = a.peekValue(index);
-        if (value == null || !isFractionValue(value)) {
-            return defValue;
-        }
-        return a.getFraction(index, 1, 1, defValue);
-    }
-
-    public static float getFraction(final TypedArray a, final int index) {
-        return getFraction(a, index, UNDEFINED_RATIO);
-    }
-
-    public static int getDimensionPixelSize(final TypedArray a, final int index) {
-        final TypedValue value = a.peekValue(index);
-        if (value == null || !isDimensionValue(value)) {
-            return ResourceUtils.UNDEFINED_DIMENSION;
-        }
-        return a.getDimensionPixelSize(index, ResourceUtils.UNDEFINED_DIMENSION);
-    }
-
-    public static float getDimensionOrFraction(TypedArray a, int index, int base,
-            float defValue) {
-        final TypedValue value = a.peekValue(index);
-        if (value == null) {
-            return defValue;
-        }
-        if (isFractionValue(value)) {
-            return a.getFraction(index, base, base, defValue);
-        } else if (isDimensionValue(value)) {
-            return a.getDimension(index, defValue);
-        }
-        return defValue;
-    }
-
-    public static int getEnumValue(TypedArray a, int index, int defValue) {
-        final TypedValue value = a.peekValue(index);
-        if (value == null) {
-            return defValue;
-        }
-        if (isIntegerValue(value)) {
-            return a.getInt(index, defValue);
-        }
-        return defValue;
-    }
-
-    public static boolean isFractionValue(TypedValue v) {
-        return v.type == TypedValue.TYPE_FRACTION;
-    }
-
-    public static boolean isDimensionValue(TypedValue v) {
-        return v.type == TypedValue.TYPE_DIMENSION;
-    }
-
-    public static boolean isIntegerValue(TypedValue v) {
-        return v.type >= TypedValue.TYPE_FIRST_INT && v.type <= TypedValue.TYPE_LAST_INT;
-    }
-
-    public static boolean isStringValue(TypedValue v) {
-        return v.type == TypedValue.TYPE_STRING;
-    }
 }
diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
index 9e8ab81..03263d2 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionStripView.java
@@ -61,7 +61,6 @@
 import com.android.inputmethod.latin.CollectionUtils;
 import com.android.inputmethod.latin.LatinImeLogger;
 import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.ResourceUtils;
 import com.android.inputmethod.latin.StaticInnerHandlerWrapper;
 import com.android.inputmethod.latin.SuggestedWords;
 import com.android.inputmethod.latin.Utils;
@@ -197,15 +196,15 @@
                     R.styleable.SuggestionStripView, defStyle, R.style.SuggestionStripViewStyle);
             mSuggestionStripOption = a.getInt(
                     R.styleable.SuggestionStripView_suggestionStripOption, 0);
-            final float alphaValidTypedWord = ResourceUtils.getFraction(a,
+            final float alphaValidTypedWord = getFraction(a,
                     R.styleable.SuggestionStripView_alphaValidTypedWord, 1.0f);
-            final float alphaTypedWord = ResourceUtils.getFraction(a,
+            final float alphaTypedWord = getFraction(a,
                     R.styleable.SuggestionStripView_alphaTypedWord, 1.0f);
-            final float alphaAutoCorrect = ResourceUtils.getFraction(a,
+            final float alphaAutoCorrect = getFraction(a,
                     R.styleable.SuggestionStripView_alphaAutoCorrect, 1.0f);
-            final float alphaSuggested = ResourceUtils.getFraction(a,
+            final float alphaSuggested = getFraction(a,
                     R.styleable.SuggestionStripView_alphaSuggested, 1.0f);
-            mAlphaObsoleted = ResourceUtils.getFraction(a,
+            mAlphaObsoleted = getFraction(a,
                     R.styleable.SuggestionStripView_alphaSuggested, 1.0f);
             mColorValidTypedWord = applyAlpha(a.getColor(
                     R.styleable.SuggestionStripView_colorValidTypedWord, 0), alphaValidTypedWord);
@@ -218,13 +217,13 @@
             mSuggestionsCountInStrip = a.getInt(
                     R.styleable.SuggestionStripView_suggestionsCountInStrip,
                     DEFAULT_SUGGESTIONS_COUNT_IN_STRIP);
-            mCenterSuggestionWeight = ResourceUtils.getFraction(a,
+            mCenterSuggestionWeight = getFraction(a,
                     R.styleable.SuggestionStripView_centerSuggestionPercentile,
                     DEFAULT_CENTER_SUGGESTION_PERCENTILE);
             mMaxMoreSuggestionsRow = a.getInt(
                     R.styleable.SuggestionStripView_maxMoreSuggestionsRow,
                     DEFAULT_MAX_MORE_SUGGESTIONS_ROW);
-            mMinMoreSuggestionsWidth = ResourceUtils.getFraction(a,
+            mMinMoreSuggestionsWidth = getFraction(a,
                     R.styleable.SuggestionStripView_minMoreSuggestionsWidth, 1.0f);
             a.recycle();
 
@@ -279,6 +278,10 @@
             return new BitmapDrawable(res, buffer);
         }
 
+        static float getFraction(final TypedArray a, final int index, final float defValue) {
+            return a.getFraction(index, 1, 1, defValue);
+        }
+
         private CharSequence getStyledSuggestionWord(SuggestedWords suggestedWords, int pos) {
             final CharSequence word = suggestedWords.getWord(pos);
             final boolean isAutoCorrect = pos == 1 && suggestedWords.willAutoCorrect();
