Search in sources :

Example 11 with DeviceService

use of com.connectsdk.service.DeviceService in project butter-android by butterproject.

the class PairingDialog method getPairingDialog.

public AlertDialog getPairingDialog(String message) {
    TextView title = (TextView) activity.getLayoutInflater().inflate(android.R.layout.simple_list_item_1, null);
    title.setText(message);
    final EditText input = new EditText(activity);
    input.setInputType(InputType.TYPE_CLASS_NUMBER);
    return new AlertDialog.Builder(activity).setCustomTitle(title).setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            String value = input.getText().toString().trim();
            for (DeviceService service : device.getServices()) service.sendPairingKey(value);
        }
    }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {

        public void onClick(DialogInterface dialog, int whichButton) {
            dialog.cancel();
        // pickerDialog.dismiss();
        }
    }).create();
}
Also used : EditText(android.widget.EditText) AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) DeviceService(com.connectsdk.service.DeviceService) TextView(android.widget.TextView)

Aggregations

DeviceService (com.connectsdk.service.DeviceService)11 NetcastTVService (com.connectsdk.service.NetcastTVService)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 JSONException (org.json.JSONException)2 JSONObject (org.json.JSONObject)2 AlertDialog (android.app.AlertDialog)1 DialogInterface (android.content.DialogInterface)1 EditText (android.widget.EditText)1 TextView (android.widget.TextView)1 ConnectableDevice (com.connectsdk.device.ConnectableDevice)1 AirPlayService (com.connectsdk.service.AirPlayService)1 CastService (com.connectsdk.service.CastService)1 DLNAService (com.connectsdk.service.DLNAService)1 RokuService (com.connectsdk.service.RokuService)1 WebOSTVService (com.connectsdk.service.WebOSTVService)1 CapabilityPriorityLevel (com.connectsdk.service.capability.CapabilityMethods.CapabilityPriorityLevel)1 ServiceConfig (com.connectsdk.service.config.ServiceConfig)1 ArrayList (java.util.ArrayList)1