mirror of
https://github.com/gsantner/dandelion
synced 2024-12-22 19:08:03 +01:00
Fixed #127
This commit is contained in:
parent
dbafcc065c
commit
6037c0b3eb
1 changed files with 32 additions and 0 deletions
|
@ -18,10 +18,16 @@
|
|||
*/
|
||||
package com.github.dfa.diaspora_android.web;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.webkit.JsResult;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.ui.theme.ThemedAlertDialogBuilder;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.AppSettings;
|
||||
|
||||
/**
|
||||
* WebChromeClient that handles sharing text to diaspora*
|
||||
|
@ -54,6 +60,32 @@ public class DiasporaStreamWebChromeClient extends FileUploadWebChromeClient {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
|
||||
ThemedAlertDialogBuilder builder = new ThemedAlertDialogBuilder(view.getContext(), new AppSettings(view.getContext()));
|
||||
builder.setTitle(view.getContext().getString(R.string.confirmation))
|
||||
.setMessage(message)
|
||||
.setPositiveButton(android.R.string.ok,
|
||||
new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.confirm();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(android.R.string.cancel,
|
||||
new DialogInterface.OnClickListener()
|
||||
{
|
||||
public void onClick(DialogInterface dialog, int which)
|
||||
{
|
||||
result.cancel();
|
||||
}
|
||||
})
|
||||
.create()
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
public interface SharedTextCallback {
|
||||
String getSharedText();
|
||||
|
||||
|
|
Loading…
Reference in a new issue