问题
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