I have tried to answer the question and I have made a significant effort, but this is not the perfect answer,  I have came up with following
Step-1 create custom_preview.xml file in drawable folder write some thing like:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:padding="5dp"
       android:shape="rectangle" >
      <solid android:color="#436EEE" />
      <corners android:radius="4dp" />
</shape>
Step-2 create popup_prewview_layout.xml file in layout folder write this:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"   
          android:layout_width="20dp"
          android:layout_height="wrap_content"
          android:background="@drawable/custom_preview"
          android:gravity="center"
          android:textColor="@android:color/white"
          android:textSize="32sp" />
Step-3 now in main_layout.xml add android:keyPreviewLayout="@layout/popup_preview_layout", like this :
<?xml version="1.0" encoding="utf-8"?>
<com.example.keyboard.KeyboardView  xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/keyboard"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:background="#FF272727"
          android:keyPreviewLayout="@layout/keyboard_popup_preview"/>
RESULT

OK so that was effort, but not the perfect solution for you, because there is not any triangle at the bottom of preview. that maybe an other question. Hope this is some thing working for you...