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

This commit is contained in:
Daniel Gultsch 2019-11-08 12:18:39 +01:00
parent abc1cb5a89
commit b320dea4d9
1 changed files with 8 additions and 0 deletions

View File

@ -168,9 +168,16 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
}); });
dialog.setCanceledOnTouchOutside(false); dialog.setCanceledOnTouchOutside(false);
dialog.show(); 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 @Override
public void onSaveInstanceState(Bundle savedInstanceState) { public void onSaveInstanceState(Bundle savedInstanceState) {
if (mMenuSearchView != null && mMenuSearchView.isActionViewExpanded()) { if (mMenuSearchView != null && mMenuSearchView.isActionViewExpanded()) {
@ -183,6 +190,7 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O
SharedPreferences preferences = getPreferences(); SharedPreferences preferences = getPreferences();
preferences.edit().putBoolean(CHANNEL_DISCOVERY_OPT_IN, true).apply(); preferences.edit().putBoolean(CHANNEL_DISCOVERY_OPT_IN, true).apply();
optedIn = true; optedIn = true;
toggleLoadingScreen();
xmppConnectionService.discoverChannels(null, this.method, this); xmppConnectionService.discoverChannels(null, this.method, this);
} }