Improve Forum Sharing UI when sharing with selected contacts

When sharing only with chosen contacts, checking the contact's checkbox
and pressing Done nothing happens and the forum is not shared. An
additional click on "Share Forum" is necessary to actually share.

This behavior is fixed with this change.
Now, clicking 'Done' immediately shares the forum.

Closes #153
This commit is contained in:
Torsten Grote
2015-12-14 17:32:52 -02:00
parent 3f58af3b04
commit 4d2215a442

View File

@@ -117,15 +117,19 @@ SelectContactsDialog.Listener {
else displayVisibility(); else displayVisibility();
} else if (view == shareButton) { } else if (view == shareButton) {
if (changed) { if (changed) {
share();
} else {
finish();
}
}
}
private void share() {
// Replace the button with a progress bar // Replace the button with a progress bar
shareButton.setVisibility(GONE); shareButton.setVisibility(GONE);
progress.setVisibility(VISIBLE); progress.setVisibility(VISIBLE);
// Update the group in a background thread // Update the group in a background thread
storeVisibility(shareWithAll.isChecked()); storeVisibility(shareWithAll.isChecked());
} else {
finish();
}
}
} }
private void loadVisibility() { private void loadVisibility() {
@@ -194,6 +198,7 @@ SelectContactsDialog.Listener {
public void contactsSelected(Collection<ContactId> selected) { public void contactsSelected(Collection<ContactId> selected) {
this.selected = Collections.unmodifiableCollection(selected); this.selected = Collections.unmodifiableCollection(selected);
share();
} }
public void contactSelectionCancelled() { public void contactSelectionCancelled() {