Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Fixed disappearing ProgressDialog on touch
Browse files Browse the repository at this point in the history
made the branch even with master
  • Loading branch information
DravitLochan committed Mar 5, 2017
1 parent b596202 commit 23ba45b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ private boolean isUrlValid(String url) {

private void showBackends(String httpScheme, String serverURL) {
commonProgressDialog.showWithMessage(getString(R.string.connecting_to_server));
commonProgressDialog.setCancelable(false);
// if server url does not end with "/", then append it
if (!serverURL.endsWith("/")) {
serverURL = serverURL + "/";
Expand Down Expand Up @@ -498,13 +499,15 @@ public void onClick(View v) {
switch (v.getId()) {
case R.id.google_sign_in_button:
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
commonProgressDialog.setCancelable(false);
setupGoogleSignIn();
break;
case R.id.zulip_login:
if (!isInputValid()) {
return;
}
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
commonProgressDialog.setCancelable(false);
String username = mUserName.getText().toString();
String password = mPassword.getText().toString();
getServices()
Expand Down Expand Up @@ -559,6 +562,7 @@ public void onFailure(Call<LoginResponse> call, Throwable t) {
case R.id.local_server_button:
if (!isInputValidForDevAuth()) return;
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
commonProgressDialog.setCancelable(false);
AsyncDevGetEmails asyncDevGetEmails = new AsyncDevGetEmails(LoginActivity.this);
asyncDevGetEmails.setCallback(new ZulipAsyncPushTask.AsyncTaskCompleteListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,7 @@ public void onClick(
case R.id.refresh:
Log.w("menu", "Refreshed manually by user. We shouldn't need this.");
commonProgressDialog.showWithMessage(getString(R.string.refreshing));
commonProgressDialog.setCancelable(false);
onRefresh();
break;
case R.id.today:
Expand Down Expand Up @@ -2141,6 +2142,7 @@ private void setNightMode(@AppCompatDelegate.NightMode int nightMode) {
*/
private void logout() {
commonProgressDialog.showWithMessage(getString(R.string.logging_out));
commonProgressDialog.setCancelable(false);
this.logged_in = false;
final String serverUrl = app.getServerHostUri();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ public boolean isShowing() {
public void setMessage(String message) {
progressDialog.setMessage(message);
}

public void setCancelable(boolean cancelable) {
progressDialog.setCancelable(cancelable);
}
}

0 comments on commit 23ba45b

Please sign in to comment.