Custom android IME keyboard with one button

605 views Asked by At

I wanna create a IME and custom the keyboard with single button.Here is my code in InputMethodService:

@Override
public View onCreateInputView() {
    mKeyboardView = (RelativeLayout) 
                    getLayoutInflater().inflate(R.layout.input, null);
    return mKeyboardView;
}

And here is the layout input.xml

   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:layout_alignParentBottom="true"
    android:background="#000000">
    <Button
        android:layout_width="10dp"
        android:layout_height="10dp"
        android:gravity="bottom"/>

</RelativeLayout>

But the problem is: when I click the EditText on my device(already turn the system IME to mine in settings) there is a full-screen edit layout which is not relevant with input.xml at all.

This is the screenshot:

enter image description here

1

There are 1 answers

0
Im.a.Outman On BEST ANSWER

I find the answer by decompilation of Google's LatinIME.apk.Finally I saw a function onEvaluateFullscreenMode()

Yes,just override this function and return false.The custom keyboard layout won't be full-screen anymore.