Search in sources :

Example 1 with TextInputStatusListener

use of com.connectsdk.service.capability.TextInputControl.TextInputStatusListener in project butter-android by butterproject.

the class WebOSTVKeyboardInput method connect.

public URLServiceSubscription<TextInputStatusListener> connect(final TextInputStatusListener listener) {
    ResponseListener<Object> responseListener = new ResponseListener<Object>() {

        @Override
        public void onSuccess(Object response) {
            JSONObject jsonObj = (JSONObject) response;
            TextInputStatusInfo keyboard = parseRawKeyboardData(jsonObj);
            Util.postSuccess(listener, keyboard);
        }

        @Override
        public void onError(ServiceCommandError error) {
            Util.postError(listener, error);
        }
    };
    URLServiceSubscription<TextInputStatusListener> subscription = new URLServiceSubscription<TextInputStatusListener>(service, KEYBOARD_INPUT, null, true, responseListener);
    subscription.send();
    return subscription;
}
Also used : JSONObject(org.json.JSONObject) URLServiceSubscription(com.connectsdk.service.command.URLServiceSubscription) TextInputStatusListener(com.connectsdk.service.capability.TextInputControl.TextInputStatusListener) JSONObject(org.json.JSONObject) ServiceCommandError(com.connectsdk.service.command.ServiceCommandError) ResponseListener(com.connectsdk.service.capability.listeners.ResponseListener) TextInputStatusInfo(com.connectsdk.core.TextInputStatusInfo)

Aggregations

TextInputStatusInfo (com.connectsdk.core.TextInputStatusInfo)1 TextInputStatusListener (com.connectsdk.service.capability.TextInputControl.TextInputStatusListener)1 ResponseListener (com.connectsdk.service.capability.listeners.ResponseListener)1 ServiceCommandError (com.connectsdk.service.command.ServiceCommandError)1 URLServiceSubscription (com.connectsdk.service.command.URLServiceSubscription)1 JSONObject (org.json.JSONObject)1