Expose javascript:window.alert() to libsimpleservo

This commit is contained in:
Paul Rouget 2019-07-18 12:46:19 +02:00
parent b6cc0f60a9
commit 3a374b3455
7 changed files with 42 additions and 0 deletions

View file

@ -129,6 +129,10 @@ public class MainActivity extends Activity implements Servo.Client {
mServoView.stop();
}
@Override
public void onAlert(String message) {
}
@Override
public void onLoadStarted() {
mReloadButton.setEnabled(false);

View file

@ -93,6 +93,8 @@ public class JNIServo {
void makeCurrent();
void onAlert(String message);
void onAnimatingChanged(boolean animating);
void onLoadStarted();

View file

@ -169,6 +169,8 @@ public class Servo {
}
public interface Client {
void onAlert(String message);
boolean onAllowNavigation(String url);
void onLoadStarted();
@ -228,6 +230,10 @@ public class Servo {
mGfxCb.makeCurrent();
}
public void onAlert(String message) {
mRunCallback.inUIThread(() -> mClient.onAlert(message));
}
public void onShutdownComplete() {
mShutdownComplete = true;
}