user4527757
user4527757

Reputation:

how to change layout fo candidateView for my custom keyboard in android

i am making a custom keyboard with the help of android softkeyboard(which is provided with the sdk) i am showing word suggestion(or word prediction) on candidate view. it look like this....https://www.dropbox.com/s/p14gzaybaj5c18o/auto_correction.PNG?dl=0 but i wanted to show the suggestion like this.... https://www.dropbox.com/s/bkwnigmcswyn2wf/auto_correction_2.PNG?dl=0

how can i do such modification? My CandidateView class is remain exactly like default softkeyboard source code. Thanks in advance :)

Upvotes: 1

Views: 1010

Answers (2)

meyasir
meyasir

Reputation: 278

Sorry, Your Images are corrupted. I'm guessing that it is the same problem everyone faced while working on the soft keyboard from the android sample code. I found the perfect solution that should work refrence. Just override the following method in the InputMethodService.

//added for candidateView size adjusting
@Override
public void onComputeInsets(InputMethodService.Insets outInsets) {
    super.onComputeInsets(outInsets);
    if (!isFullscreenMode()) {
        outInsets.contentTopInsets = outInsets.visibleTopInsets;
    }
}

Upvotes: 1

Gabe Sechan
Gabe Sechan

Reputation: 93561

onCreateCandidateView returns the view that's put into the candidate view. You can return a view that looks any way you want.

Upvotes: 0

Related Questions