mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-12-25 00:48:50 -05:00
Directly jump to server view on click and watch the client connecting
This commit is contained in:
parent
dda143186b
commit
ac48ee9aae
@ -118,20 +118,15 @@ public class ServersActivity extends ListActivity implements ServiceConnection,
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
final Server server = adapter.getItem(position);
|
Server server = adapter.getItem(position);
|
||||||
|
|
||||||
switch (server.getStatus()) {
|
|
||||||
case Status.DISCONNECTED:
|
|
||||||
server.setStatus(Status.CONNECTING);
|
server.setStatus(Status.CONNECTING);
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
binder.connect(server);
|
binder.connect(server);
|
||||||
break;
|
|
||||||
case Status.CONNECTED:
|
|
||||||
Intent intent = new Intent(this, ServerActivity.class);
|
Intent intent = new Intent(this, ServerActivity.class);
|
||||||
intent.putExtra("serverId", server.getId());
|
intent.putExtra("serverId", server.getId());
|
||||||
startActivityForResult(intent, 0);
|
startActivityForResult(intent, 0);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user