am 344a7fef: am 658e935b: am c0bc3369: Merge "Fix more suggestions text width calculation" into jb-mr1-dev
* commit '344a7fef5bd101e2d1c4278cc35de2862f28a456': Fix more suggestions text width calculationmain
commit
788c885aa5
|
@ -105,7 +105,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
private static final String TAG = KeyboardView.class.getSimpleName();
|
private static final String TAG = KeyboardView.class.getSimpleName();
|
||||||
|
|
||||||
// XML attributes
|
// XML attributes
|
||||||
private final KeyVisualAttributes mKeyVisualAttributes;
|
protected final KeyVisualAttributes mKeyVisualAttributes;
|
||||||
private final int mKeyLabelHorizontalPadding;
|
private final int mKeyLabelHorizontalPadding;
|
||||||
private final float mKeyHintLetterPadding;
|
private final float mKeyHintLetterPadding;
|
||||||
private final float mKeyPopupHintLetterPadding;
|
private final float mKeyPopupHintLetterPadding;
|
||||||
|
@ -733,6 +733,7 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove this method.
|
||||||
public float getLabelWidth(final String label, final Paint paint) {
|
public float getLabelWidth(final String label, final Paint paint) {
|
||||||
paint.getTextBounds(label, 0, label.length(), mTextBounds);
|
paint.getTextBounds(label, 0, label.length(), mTextBounds);
|
||||||
return mTextBounds.width();
|
return mTextBounds.width();
|
||||||
|
|
|
@ -50,10 +50,11 @@ public final class MoreSuggestions extends Keyboard {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Remove {@link MoreSuggestionsView} argument.
|
||||||
public int layout(final SuggestedWords suggestions, final int fromPos, final int maxWidth,
|
public int layout(final SuggestedWords suggestions, final int fromPos, final int maxWidth,
|
||||||
final int minWidth, final int maxRow, final MoreSuggestionsView view) {
|
final int minWidth, final int maxRow, final MoreSuggestionsView view) {
|
||||||
clearKeys();
|
clearKeys();
|
||||||
final Resources res = view.getContext().getResources();
|
final Resources res = view.getResources();
|
||||||
mDivider = res.getDrawable(R.drawable.more_suggestions_divider);
|
mDivider = res.getDrawable(R.drawable.more_suggestions_divider);
|
||||||
mDividerWidth = mDivider.getIntrinsicWidth();
|
mDividerWidth = mDivider.getIntrinsicWidth();
|
||||||
final int padding = (int) res.getDimension(
|
final int padding = (int) res.getDimension(
|
||||||
|
@ -180,6 +181,7 @@ public final class MoreSuggestions extends Keyboard {
|
||||||
load(xmlId, parentKeyboard.mId);
|
load(xmlId, parentKeyboard.mId);
|
||||||
mParams.mVerticalGap = mParams.mTopPadding = parentKeyboard.mVerticalGap / 2;
|
mParams.mVerticalGap = mParams.mTopPadding = parentKeyboard.mVerticalGap / 2;
|
||||||
|
|
||||||
|
mPaneView.updateKeyboardGeometry(mParams.mDefaultRowHeight);
|
||||||
final int count = mParams.layout(suggestions, fromPos, maxWidth, minWidth, maxRow,
|
final int count = mParams.layout(suggestions, fromPos, maxWidth, minWidth, maxRow,
|
||||||
mPaneView);
|
mPaneView);
|
||||||
mFromPos = fromPos;
|
mFromPos = fromPos;
|
||||||
|
|
|
@ -106,6 +106,10 @@ public final class MoreSuggestionsView extends KeyboardView implements MoreKeysP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateKeyboardGeometry(final int keyHeight) {
|
||||||
|
mKeyDrawParams.updateParams(keyHeight, mKeyVisualAttributes);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setKeyboard(final Keyboard keyboard) {
|
public void setKeyboard(final Keyboard keyboard) {
|
||||||
super.setKeyboard(keyboard);
|
super.setKeyboard(keyboard);
|
||||||
|
|
Loading…
Reference in New Issue