@Override
  public void showPreviewForKey(
      Keyboard.Key key, Drawable icon, View parentView, PreviewPopupTheme previewPopupTheme) {
    KeyPreview popup = getPopupForKey(key, parentView, previewPopupTheme);
    Point previewPosition =
        mPositionCalculator.calculatePositionForPreview(
            key, previewPopupTheme, getLocationInWindow(parentView));
    popup.showPreviewForKey(key, icon, previewPosition);
  }
@Test
  public void testSetupPopupLayoutForKeyDrawable() {
    final Drawable drawable = getApplicationContext().getDrawable(R.drawable.ic_accept);
    KeyPreviewsManager underTest =
        new KeyPreviewsManager(getApplicationContext(), mPositionCalculator, 3);
    underTest.showPreviewForKey(mTestKeys[0], drawable, mKeyboardView, mTheme);

    final PopupWindow window = getLatestCreatedPopupWindow();
    final TextView textView = window.getContentView().findViewById(R.id.key_preview_text);
    Assert.assertEquals(View.GONE, textView.getVisibility());
    final ImageView imageView = window.getContentView().findViewById(R.id.key_preview_icon);
    Assert.assertEquals(View.VISIBLE, imageView.getVisibility());
    Assert.assertSame(drawable, imageView.getDrawable());
  }