I have created Virtual keyboard in which I have to get notified about that the particular app supports the commit content api or not ?
Since I am using custom images inside my keyboard, this checking is required.
I am using InputMethodService and its already done in a demo app to check such thing as below :
@Override
public void onStartInputView(EditorInfo info, boolean restarting) {
mGifButton.setEnabled(mGifFile != null && isCommitContentSupported(info, MIME_TYPE_GIF));
mPngButton.setEnabled(mPngFile != null && isCommitContentSupported(info, MIME_TYPE_PNG));
mWebpButton.setEnabled(mWebpFile != null && isCommitContentSupported(info, MIME_TYPE_WEBP));
}
here, in above code variables with 'm' initials are buttons.
and method onStartInputView
is overridden in which its checking for the support api and if is Supported then Buttons will be Enabled.
Its ok, buttons will disabled and change its color to little dark if its not supported. Now, since I am using GridView, i have done as below :
@Override
public void onStartInputView(EditorInfo info, boolean restarting) {
Log.e(">>>>>>Editor Info : >> ",""+info);
grid.setEnabled(imageFile1 != null && isCommitContentSupported(info, MIME_TYPE_PNG));
}
Its done, But HOW User will get notified that this is not supported.. since GridView is not changing its color or UI so that User will be aware that This is not working.
the return type of setEnabled
is void.
So, HOW this possible ?