Merge "Do not clip the popup key preview even if there is no left/right preview icons"
This commit is contained in:
commit
b8291fb46b
1 changed files with 8 additions and 4 deletions
|
@ -906,12 +906,16 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
|
||||||
int previewX = keyDrawX - (previewWidth - keyDrawWidth) / 2 + params.mCoordinates[0];
|
int previewX = keyDrawX - (previewWidth - keyDrawWidth) / 2 + params.mCoordinates[0];
|
||||||
final int previewY = key.mY - previewHeight
|
final int previewY = key.mY - previewHeight
|
||||||
+ params.mCoordinates[1] + params.mPreviewOffset;
|
+ params.mCoordinates[1] + params.mPreviewOffset;
|
||||||
if (previewX < 0 && params.mPreviewLeftBackground != null) {
|
if (previewX < 0) {
|
||||||
previewText.setBackgroundDrawable(params.mPreviewLeftBackground);
|
|
||||||
previewX = 0;
|
previewX = 0;
|
||||||
} else if (previewX + previewWidth > getWidth() && params.mPreviewRightBackground != null) {
|
if (params.mPreviewLeftBackground != null) {
|
||||||
previewText.setBackgroundDrawable(params.mPreviewRightBackground);
|
previewText.setBackgroundDrawable(params.mPreviewLeftBackground);
|
||||||
|
}
|
||||||
|
} else if (previewX > getWidth() - previewWidth) {
|
||||||
previewX = getWidth() - previewWidth;
|
previewX = getWidth() - previewWidth;
|
||||||
|
if (params.mPreviewRightBackground != null) {
|
||||||
|
previewText.setBackgroundDrawable(params.mPreviewRightBackground);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the preview background state
|
// Set the preview background state
|
||||||
|
|
Loading…
Reference in a new issue