Android Soft Keyboard - pop-up preview window blocked / disabled on the top edge of the keyboard?

I am working on a keyboard and now I am focusing on key previews. I am using drawable,

<?xml version="1.0" encoding="utf-8"?>

<item>
    <shape>
        <padding android:top="10sp" android:right="10sp" android:bottom="5sp" android:left="10sp" />
        <solid android:color="#00000000" />
    </shape>
</item>
<item>
    <shape>
        <padding android:top="0sp" android:right="0sp" android:bottom="1sp" android:left="0sp" />
        <solid android:color="#d4d4d4" />
        <corners android:radius="4sp" />
    </shape>
</item>
<item>
    <shape>
        <padding android:top="0sp" android:right="0sp" android:bottom="1sp" android:left="0sp" />
        <solid android:color="#dddddd" />
        <corners android:radius="4sp" />
    </shape>
</item>
<item>
    <shape >
        <solid android:color="#FFD1D6D9" />
        <corners android:radius="4sp" />
    </shape>
</item>

and tried the setup,

android:clipChildren="false"
android:clipToPadding="false"

in the keyboard XML file. I was looking for a similar behavior for GBoard pop-ups, where pop-up pop-ups are displayed above each item. The bottom row works great; the middle line slightly pushes the popup (it looks like it always sets the top edge of the keyboard preview popup at the top of the keyboard if it exceeds it), and the top line really shows nothing. Did I forget the settings or Android just won't let me do it right? Do you think that Google did this on GBoard?

+4

Source: https://habr.com/ru/post/1678781/


All Articles