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

Commit 23ba45b

Browse files
committed
Fixed disappearing ProgressDialog on touch
made the branch even with master
1 parent b596202 commit 23ba45b

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

app/src/main/java/com/zulip/android/activities/LoginActivity.java

+4
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ private boolean isUrlValid(String url) {
271271

272272
private void showBackends(String httpScheme, String serverURL) {
273273
commonProgressDialog.showWithMessage(getString(R.string.connecting_to_server));
274+
commonProgressDialog.setCancelable(false);
274275
// if server url does not end with "/", then append it
275276
if (!serverURL.endsWith("/")) {
276277
serverURL = serverURL + "/";
@@ -498,13 +499,15 @@ public void onClick(View v) {
498499
switch (v.getId()) {
499500
case R.id.google_sign_in_button:
500501
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
502+
commonProgressDialog.setCancelable(false);
501503
setupGoogleSignIn();
502504
break;
503505
case R.id.zulip_login:
504506
if (!isInputValid()) {
505507
return;
506508
}
507509
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
510+
commonProgressDialog.setCancelable(false);
508511
String username = mUserName.getText().toString();
509512
String password = mPassword.getText().toString();
510513
getServices()
@@ -559,6 +562,7 @@ public void onFailure(Call<LoginResponse> call, Throwable t) {
559562
case R.id.local_server_button:
560563
if (!isInputValidForDevAuth()) return;
561564
commonProgressDialog.showWithMessage(getString(R.string.signing_in));
565+
commonProgressDialog.setCancelable(false);
562566
AsyncDevGetEmails asyncDevGetEmails = new AsyncDevGetEmails(LoginActivity.this);
563567
asyncDevGetEmails.setCallback(new ZulipAsyncPushTask.AsyncTaskCompleteListener() {
564568
@Override

app/src/main/java/com/zulip/android/activities/ZulipActivity.java

+2
Original file line numberDiff line numberDiff line change
@@ -2082,6 +2082,7 @@ public void onClick(
20822082
case R.id.refresh:
20832083
Log.w("menu", "Refreshed manually by user. We shouldn't need this.");
20842084
commonProgressDialog.showWithMessage(getString(R.string.refreshing));
2085+
commonProgressDialog.setCancelable(false);
20852086
onRefresh();
20862087
break;
20872088
case R.id.today:
@@ -2141,6 +2142,7 @@ private void setNightMode(@AppCompatDelegate.NightMode int nightMode) {
21412142
*/
21422143
private void logout() {
21432144
commonProgressDialog.showWithMessage(getString(R.string.logging_out));
2145+
commonProgressDialog.setCancelable(false);
21442146
this.logged_in = false;
21452147
final String serverUrl = app.getServerHostUri();
21462148

app/src/main/java/com/zulip/android/util/CommonProgressDialog.java

+4
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ public boolean isShowing() {
3737
public void setMessage(String message) {
3838
progressDialog.setMessage(message);
3939
}
40+
41+
public void setCancelable(boolean cancelable) {
42+
progressDialog.setCancelable(cancelable);
43+
}
4044
}

0 commit comments

Comments
 (0)