mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-31 17:32:51 +08:00
Merge branch 'master' into 4.0.x (CordovaPlugin.pluginInitialize tweak)
Conflicts: framework/src/org/apache/cordova/CordovaPlugin.java
This commit is contained in:
commit
1d4aa44d3d
@ -36,23 +36,31 @@ public class CordovaPlugin {
|
|||||||
public CordovaInterface cordova;
|
public CordovaInterface cordova;
|
||||||
protected CordovaPreferences preferences;
|
protected CordovaPreferences preferences;
|
||||||
|
|
||||||
void privateInitialize(CordovaInterface cordova, CordovaWebView webView, CordovaPreferences preferences) {
|
/**
|
||||||
|
* Call this after constructing to initialize the plugin.
|
||||||
|
* Final because we want to be able to change args without breaking plugins.
|
||||||
|
*/
|
||||||
|
public final void privateInitialize(CordovaInterface cordova, CordovaWebView webView, CordovaPreferences preferences) {
|
||||||
assert this.cordova == null;
|
assert this.cordova == null;
|
||||||
this.cordova = cordova;
|
this.cordova = cordova;
|
||||||
this.webView = webView;
|
this.webView = webView;
|
||||||
this.preferences = preferences;
|
this.preferences = preferences;
|
||||||
initialize(cordova, webView);
|
initialize(cordova, webView);
|
||||||
initialize();
|
pluginInitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated // Override initialize() instead.
|
/**
|
||||||
|
* Called after plugin construction and fields have been initialized.
|
||||||
|
* Prefer to use pluginInitialize instead since there is no value in
|
||||||
|
* having parameters on the initialize() function.
|
||||||
|
*/
|
||||||
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
public void initialize(CordovaInterface cordova, CordovaWebView webView) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is where you can do start-up logic with protected fields set.
|
* Called after plugin construction and fields have been initialized.
|
||||||
*/
|
*/
|
||||||
protected void initialize() {
|
protected void pluginInitialize() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user