Search in sources :

Example 1 with ConnectionChooserDialog

use of com.genonbeta.TrebleShot.dialog.ConnectionChooserDialog in project TrebleShot by genonbeta.

the class TransactionActivity method changeConnection.

private void changeConnection() {
    new ConnectionChooserDialog(this, mDatabase, mDevice, new ConnectionChooserDialog.OnDeviceSelectedListener() {

        @Override
        public void onDeviceSelected(NetworkDevice.Connection connection, ArrayList<NetworkDevice.Connection> connectionList) {
            mGroup.connectionAdapter = connection.adapterName;
            mDatabase.publish(mGroup);
            createSnackbar(R.string.mesg_connectionUpdated, getString(TextUtils.getAdapterName(connection))).show();
        }
    }, false).show();
}
Also used : NetworkDevice(com.genonbeta.TrebleShot.object.NetworkDevice) ArrayList(java.util.ArrayList) ConnectionChooserDialog(com.genonbeta.TrebleShot.dialog.ConnectionChooserDialog)

Example 2 with ConnectionChooserDialog

use of com.genonbeta.TrebleShot.dialog.ConnectionChooserDialog in project TrebleShot by genonbeta.

the class ShareActivity method showChooserDialog.

protected void showChooserDialog(final NetworkDevice device) {
    device.isRestricted = false;
    mDatabase.publish(device);
    new ConnectionChooserDialog(ShareActivity.this, mDatabase, device, new ConnectionChooserDialog.OnDeviceSelectedListener() {

        @Override
        public void onDeviceSelected(final NetworkDevice.Connection connection, ArrayList<NetworkDevice.Connection> availableInterfaces) {
            doCommunicate(device, connection);
        }
    }, true).show();
}
Also used : NetworkDevice(com.genonbeta.TrebleShot.object.NetworkDevice) ServiceConnection(android.content.ServiceConnection) ArrayList(java.util.ArrayList) ConnectionChooserDialog(com.genonbeta.TrebleShot.dialog.ConnectionChooserDialog)

Aggregations

ConnectionChooserDialog (com.genonbeta.TrebleShot.dialog.ConnectionChooserDialog)2 NetworkDevice (com.genonbeta.TrebleShot.object.NetworkDevice)2 ArrayList (java.util.ArrayList)2 ServiceConnection (android.content.ServiceConnection)1