mirror of
https://github.com/apache/cordova-android.git
synced 2025-03-16 08:21:04 +08:00
Switching to native
This commit is contained in:
parent
dc58c67883
commit
9bf83337c9
@ -48,6 +48,7 @@ import android.webkit.WebSettings;
|
|||||||
import android.webkit.WebStorage;
|
import android.webkit.WebStorage;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
import android.webkit.GeolocationPermissions.Callback;
|
||||||
import android.webkit.WebSettings.LayoutAlgorithm;
|
import android.webkit.WebSettings.LayoutAlgorithm;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.os.Build.*;
|
import android.os.Build.*;
|
||||||
@ -122,7 +123,7 @@ public class DroidGap extends Activity {
|
|||||||
// Turn on DOM storage!
|
// Turn on DOM storage!
|
||||||
WebViewReflect.setDomStorage(settings);
|
WebViewReflect.setDomStorage(settings);
|
||||||
// Turn off native geolocation object in browser - we use our own :)
|
// Turn off native geolocation object in browser - we use our own :)
|
||||||
WebViewReflect.setGeolocationEnabled(settings, false);
|
WebViewReflect.setGeolocationEnabled(settings, true);
|
||||||
/* Bind the appView object to the gap class methods */
|
/* Bind the appView object to the gap class methods */
|
||||||
bindBrowser(appView);
|
bindBrowser(appView);
|
||||||
if(cupcakeStorage != null)
|
if(cupcakeStorage != null)
|
||||||
@ -131,6 +132,10 @@ public class DroidGap extends Activity {
|
|||||||
root.addView(appView);
|
root.addView(appView);
|
||||||
|
|
||||||
setContentView(root);
|
setContentView(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void invoke(String origin, boolean allow, boolean remember) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -272,6 +277,13 @@ public class DroidGap extends Activity {
|
|||||||
Log.d(TAG, sourceID + ": Line " + Integer.toString(lineNumber) + " : " + message);
|
Log.d(TAG, sourceID + ": Line " + Integer.toString(lineNumber) + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onGeolocationPermissionsShowPrompt(String origin, Callback callback) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
super.onGeolocationPermissionsShowPrompt(origin, callback);
|
||||||
|
callback.invoke(origin, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user