Gboard like search bar in Android IME

空扰寡人 提交于 2019-12-01 05:26:18

问题


I want to create a search bar like Gboard inside keyboard (Android IME) as shown in picture.

Gboard Sample :

I have implemented an edittext on Keyboardview.xml as shown in picture.

My Implementation :

main_keyboard_frame.xml

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="120dp"
    android:background="#cf060610"
    android:id="@+id/search_panel"
    android:visibility="invisible">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:hint="sdsddsd"
        android:id="@+id/ed"/>



</RelativeLayout>

But the problem is when i press the edittext 2 (that is outside my ime) then my ime is open that contains edittext 1 as shown in above picture now when i write some thing from my ime it writes on edittext 2 instead of edittext 1 so i want to know whats the problem behind this? is it with focus? or something else?

来源:https://stackoverflow.com/questions/55176159/gboard-like-search-bar-in-android-ime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!