@Override
  public Point calculatePositionForPreview(
      Keyboard.Key key, PreviewPopupTheme theme, int[] windowOffset) {
    Point point = new Point(key.x + windowOffset[0], windowOffset[1]);

    Rect padding = new Rect();
    theme.getPreviewKeyBackground().getPadding(padding);

    point.offset((key.width / 2), padding.bottom - theme.getVerticalOffset());

    return point;
  }
@Test
  public void testCalculatePositionForPreviewWithNoneExtendAnimation() throws Exception {
    mTheme.setPreviewAnimationType(PreviewPopupTheme.ANIMATION_STYLE_APPEAR);

    int[] offsets = new int[] {50, 60};

    Point result = mUnderTest.calculatePositionForPreview(mTestKey, mTheme, offsets);

    Assert.assertEquals(mTestKey.x + mTestKey.width / 2 + offsets[0], result.x);
    Assert.assertEquals(offsets[1], result.y);
  }