1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-22 04:12:08 +01:00

Fix webview-js dialog not dismissing correctly

This commit is contained in:
Gregor Santner 2018-03-30 01:41:43 +02:00
parent 08242760bb
commit 618f3eaaba
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
3 changed files with 8 additions and 17 deletions

View file

@ -100,6 +100,7 @@ public class ContextMenuWebView extends NestedWebView {
MainActivity.REQUEST_CODE__ACCESS_EXTERNAL_STORAGE); MainActivity.REQUEST_CODE__ACCESS_EXTERNAL_STORAGE);
} }
}) })
.setCancelable(false)
.setNegativeButton(context.getText(android.R.string.no), null) .setNegativeButton(context.getText(android.R.string.no), null)
.show(); .show();
} }

View file

@ -18,7 +18,6 @@
*/ */
package com.github.dfa.diaspora_android.web; package com.github.dfa.diaspora_android.web;
import android.content.DialogInterface;
import android.webkit.JsResult; import android.webkit.JsResult;
import android.webkit.WebView; import android.webkit.WebView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@ -65,20 +64,13 @@ public class DiasporaStreamWebChromeClient extends FileUploadWebChromeClient {
ThemedAlertDialogBuilder builder = new ThemedAlertDialogBuilder(view.getContext(), AppSettings.get()); ThemedAlertDialogBuilder builder = new ThemedAlertDialogBuilder(view.getContext(), AppSettings.get());
builder.setTitle(view.getContext().getString(R.string.confirmation)) builder.setTitle(view.getContext().getString(R.string.confirmation))
.setMessage(message) .setMessage(message)
.setPositiveButton(android.R.string.ok, .setPositiveButton(android.R.string.ok, (dialog, which) -> result.confirm())
new DialogInterface.OnClickListener() { .setNegativeButton(android.R.string.cancel, (dialog, which) -> result.cancel())
public void onClick(DialogInterface dialog, int which) { .setOnCancelListener(dialog -> {
result.confirm();
}
})
.setNegativeButton(android.R.string.cancel,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
result.cancel(); result.cancel();
} dialog.dismiss();
}) })
.create() .create().show();
.show();
return true; return true;
} }

View file

@ -12,8 +12,6 @@ buildscript {
ext.version_library_appcompat = "27.1.0" ext.version_library_appcompat = "27.1.0"
// https://github.com/JakeWharton/butterknife/releases // https://github.com/JakeWharton/butterknife/releases
ext.version_library_butterknife = "8.8.1" ext.version_library_butterknife = "8.8.1"
// https://github.com/atlassian/commonmark-java/releases
ext.version_library_commonmark = "0.10.0"
// https://github.com/guardianproject/NetCipher/releases // https://github.com/guardianproject/NetCipher/releases
ext.version_library_netcipher = "2.0.0-alpha1" ext.version_library_netcipher = "2.0.0-alpha1"
// https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin#LookAtCentral // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin#LookAtCentral