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 { ...@@ -174,11 +174,9 @@ implements InvitationListener {
} }
void reset(AddContactView view) { void reset(AddContactView view) {
// Note: localAuthorId is not reset // Don't reset localAuthorId, networkName or useBluetooth
task = null; task = null;
taskHandle = -1; taskHandle = -1;
networkName = null;
useBluetooth = false;
localInvitationCode = -1; localInvitationCode = -1;
localConfirmationCode = remoteConfirmationCode = -1; localConfirmationCode = remoteConfirmationCode = -1;
connectionFailed = false; connectionFailed = false;
...@@ -255,12 +253,14 @@ implements InvitationListener { ...@@ -255,12 +253,14 @@ implements InvitationListener {
} }
void remoteInvitationCodeEntered(int code) { void remoteInvitationCodeEntered(int code) {
setView(new ConnectionView(this));
if(localAuthorId == null) throw new IllegalStateException(); if(localAuthorId == null) throw new IllegalStateException();
if(localInvitationCode == -1) throw new IllegalStateException(); if(localInvitationCode == -1) throw new IllegalStateException();
setView(new ConnectionView(this));
task = invitationTaskFactory.createTask(localAuthorId, task = invitationTaskFactory.createTask(localAuthorId,
localInvitationCode, code); localInvitationCode, code);
taskHandle = referenceManager.putReference(task, InvitationTask.class); 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(AddContactActivity.this);
task.addListener(new ReferenceCleaner(referenceManager, taskHandle)); task.addListener(new ReferenceCleaner(referenceManager, taskHandle));
task.connect(); task.connect();
......
...@@ -32,7 +32,6 @@ public class ConnectionView extends AddContactView { ...@@ -32,7 +32,6 @@ public class ConnectionView extends AddContactView {
code.setText(String.format("%06d", localCode)); code.setText(String.format("%06d", localCode));
addView(code); addView(code);
// FIXME: These spinners don't appear when trying again after a failure
String networkName = container.getNetworkName(); String networkName = container.getNetworkName();
if(networkName != null) { if(networkName != null) {
LinearLayout innerLayout = new LinearLayout(ctx); LinearLayout innerLayout = new LinearLayout(ctx);
...@@ -53,8 +52,7 @@ public class ConnectionView extends AddContactView { ...@@ -53,8 +52,7 @@ public class ConnectionView extends AddContactView {
addView(innerLayout); addView(innerLayout);
} }
boolean useBluetooth = container.getUseBluetooth(); if(container.getUseBluetooth()) {
if(useBluetooth) {
LinearLayout innerLayout = new LinearLayout(ctx); LinearLayout innerLayout = new LinearLayout(ctx);
innerLayout.setOrientation(HORIZONTAL); innerLayout.setOrientation(HORIZONTAL);
innerLayout.setGravity(CENTER); 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