Skip to content
Snippets Groups Projects
Commit 3787ed9e authored by akwizgran's avatar akwizgran
Browse files

Progress spinners weren't shown when retrying invitation connections.

Fixes issue #3611959.
parent 2c9ce014
No related branches found
No related tags found
No related merge requests found
......@@ -174,11 +174,9 @@ implements InvitationListener {
}
void reset(AddContactView view) {
// Note: localAuthorId is not reset
// Don't reset localAuthorId, networkName or useBluetooth
task = null;
taskHandle = -1;
networkName = null;
useBluetooth = false;
localInvitationCode = -1;
localConfirmationCode = remoteConfirmationCode = -1;
connectionFailed = false;
......@@ -255,12 +253,14 @@ implements InvitationListener {
}
void remoteInvitationCodeEntered(int code) {
setView(new ConnectionView(this));
if(localAuthorId == null) throw new IllegalStateException();
if(localInvitationCode == -1) throw new IllegalStateException();
setView(new ConnectionView(this));
task = invitationTaskFactory.createTask(localAuthorId,
localInvitationCode, code);
taskHandle = referenceManager.putReference(task, InvitationTask.class);
// FIXME: Why can't the activity clean up the reference? If the task
// has a reference to the activity (as a listener), it won't be GCed
task.addListener(AddContactActivity.this);
task.addListener(new ReferenceCleaner(referenceManager, taskHandle));
task.connect();
......
......@@ -32,7 +32,6 @@ public class ConnectionView extends AddContactView {
code.setText(String.format("%06d", localCode));
addView(code);
// FIXME: These spinners don't appear when trying again after a failure
String networkName = container.getNetworkName();
if(networkName != null) {
LinearLayout innerLayout = new LinearLayout(ctx);
......@@ -53,8 +52,7 @@ public class ConnectionView extends AddContactView {
addView(innerLayout);
}
boolean useBluetooth = container.getUseBluetooth();
if(useBluetooth) {
if(container.getUseBluetooth()) {
LinearLayout innerLayout = new LinearLayout(ctx);
innerLayout.setOrientation(HORIZONTAL);
innerLayout.setGravity(CENTER);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment