mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
Merge branch 'master' into 4.0.x (back button default behaviour fix)
Conflicts: framework/src/org/apache/cordova/CordovaChromeClient.java framework/src/org/apache/cordova/CordovaWebView.java
This commit is contained in:
commit
96a1192474
@ -155,14 +155,32 @@ exports.createProject = function(project_path, package_name, project_name, proje
|
||||
return Q.reject('Project already exists! Delete and recreate');
|
||||
}
|
||||
|
||||
//Make the package conform to Java package types
|
||||
if (!/[a-zA-Z0-9_]+\.[a-zA-Z0-9_](.[a-zA-Z0-9_])*/.test(package_name)) {
|
||||
return Q.reject('Package name must look like: com.company.Name');
|
||||
}
|
||||
|
||||
//Enforce underscore limitation
|
||||
if (/[_]+[a-zA-Z0-9_]*/.test(package_name)) {
|
||||
return Q.reject("Package name can't begin with an underscore");
|
||||
}
|
||||
|
||||
//Enforce stupid name error
|
||||
if (project_name === 'CordovaActivity') {
|
||||
return Q.reject('Project name cannot be CordovaActivity');
|
||||
}
|
||||
|
||||
//Classes in Java don't begin with numbers
|
||||
if (/[0-9]+[a-zA-Z0-9]/.test(project_name)) {
|
||||
return Q.reject('Project name must not begin with a number');
|
||||
}
|
||||
|
||||
//Class is a reserved word
|
||||
if(/[C|c]+lass+[\s|\.]/.test(package_name) && !/[a-zA-Z0-9_]+[C|c]+lass/.test(package_name))
|
||||
{
|
||||
return Q.reject('class is a reserved word');
|
||||
}
|
||||
|
||||
// Check that requirements are met and proper targets are installed
|
||||
return check_reqs.run()
|
||||
.then(function() {
|
||||
|
@ -17,7 +17,7 @@
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:windowSoftInputMode="adjustPan"
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="__PACKAGE__" android:versionName="1.0" android:versionCode="1" android:hardwareAccelerated="true">
|
||||
<supports-screens
|
||||
android:largeScreens="true"
|
||||
@ -38,6 +38,7 @@
|
||||
android:label="@string/activity_name"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@android:style/Theme.Black.NoTitleBar"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
|
||||
<intent-filter android:label="@string/launcher_name">
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@ -107,6 +107,7 @@ public class AndroidChromeClient extends WebChromeClient implements CordovaChrom
|
||||
* @param url
|
||||
* @param message
|
||||
* @param result
|
||||
* @see Other implementation in the Dialogs plugin.
|
||||
*/
|
||||
@Override
|
||||
public boolean onJsAlert(WebView view, String url, String message, final JsResult result) {
|
||||
@ -150,6 +151,7 @@ public class AndroidChromeClient extends WebChromeClient implements CordovaChrom
|
||||
* @param url
|
||||
* @param message
|
||||
* @param result
|
||||
* @see Other implementation in the Dialogs plugin.
|
||||
*/
|
||||
@Override
|
||||
public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
|
||||
@ -204,6 +206,7 @@ public class AndroidChromeClient extends WebChromeClient implements CordovaChrom
|
||||
* @param message
|
||||
* @param defaultValue
|
||||
* @param result
|
||||
* @see Other implementation in the Dialogs plugin.
|
||||
*/
|
||||
@Override
|
||||
public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, JsPromptResult result) {
|
||||
|
@ -772,12 +772,6 @@ public class AndroidWebView extends WebView implements CordovaWebView {
|
||||
return true;
|
||||
}
|
||||
// If not, then invoke default behavior
|
||||
else {
|
||||
//this.activityState = ACTIVITY_EXITING;
|
||||
//return false;
|
||||
// If they hit back button when app is initializing, app should exit instead of hang until initialization (CB2-458)
|
||||
this.cordova.getActivity().finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user