mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
Merge pull request #3625 from nextcloud/timeoutCool
Show snackbar after 10s when cool is loading to slow
This commit is contained in:
commit
0fce9555fe
3 changed files with 14 additions and 2 deletions
|
@ -408,7 +408,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
new Handler().postDelayed(() -> DisplayUtils.createSnackbar(mLoginWebView,
|
||||
R.string.fallback_weblogin_text,
|
||||
Snackbar.LENGTH_INDEFINITE)
|
||||
.setActionTextColor(getResources().getColor(R.color.primary_dark))
|
||||
.setActionTextColor(getResources().getColor(R.color.white))
|
||||
.setAction(R.string.fallback_weblogin_back, v -> {
|
||||
mLoginWebView.setVisibility(View.INVISIBLE);
|
||||
webViewLoginMethod = false;
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.net.Uri;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.webkit.JavascriptInterface;
|
||||
|
@ -42,6 +43,7 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AccountUtils;
|
||||
import com.owncloud.android.datamodel.OCFile;
|
||||
|
@ -393,6 +395,15 @@ public class RichDocumentsWebView extends ExternalSiteWebView {
|
|||
|
||||
if (!url.isEmpty()) {
|
||||
richDocumentsWebView.webview.loadUrl(url);
|
||||
|
||||
new Handler().postDelayed(() -> {
|
||||
if (richDocumentsWebView.webview.getVisibility() != View.VISIBLE) {
|
||||
DisplayUtils.createSnackbar(richDocumentsWebView.findViewById(android.R.id.content),
|
||||
R.string.timeout_richDocuments, Snackbar.LENGTH_INDEFINITE)
|
||||
.setActionTextColor(richDocumentsWebView.getResources().getColor(R.color.white))
|
||||
.setAction(R.string.fallback_weblogin_back, v -> richDocumentsWebView.closeView()).show();
|
||||
}
|
||||
}, 10 * 1000);
|
||||
} else {
|
||||
Toast.makeText(richDocumentsWebView.getApplicationContext(),
|
||||
R.string.richdocuments_failed_to_load_document, Toast.LENGTH_LONG).show();
|
||||
|
|
|
@ -857,6 +857,7 @@
|
|||
<string name="delete_entries">Delete entries</string>
|
||||
<string name="dismiss_notification_description">Dismiss notification</string>
|
||||
<string name="action_empty_notifications">Clear all notifications</string>
|
||||
<string name="timeout_richDocuments">Loading takes very long…</string>
|
||||
<string name="clear_notifications_failed">Failed to clear notifications.</string>
|
||||
<string name="remove_notification_failed">Failed to remove notification.</string>
|
||||
<string name="notification_action_failed">Failed to execute action.</string>
|
||||
|
|
Loading…
Reference in a new issue