fixed spinning wheel when switching between local and jabber.network discovery

This commit is contained in:
Christian Schneppe 2019-11-14 20:36:51 +01:00
parent 533076813b
commit 10a29f53a6
No known key found for this signature in database
GPG key ID: F30B8D686B44D87E

View file

@ -168,9 +168,16 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
});
dialog.setCanceledOnTouchOutside(false);
dialog.show();
holdLoading();
}
}
private void holdLoading() {
adapter.submitList(Collections.emptyList());
binding.progressBar.setVisibility(View.GONE);
binding.list.setBackgroundColor(StyledAttributes.getColor(this, R.attr.color_background_primary));
}
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
if (mMenuSearchView != null && mMenuSearchView.isActionViewExpanded()) {
@ -183,6 +190,7 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
SharedPreferences preferences = getPreferences();
preferences.edit().putBoolean(CHANNEL_DISCOVERY_OPT_IN, true).apply();
optedIn = true;
toggleLoadingScreen();
xmppConnectionService.discoverChannels(null, this.method, this);
}