diff --git a/native/cocos/cocos2d.cpp b/native/cocos/cocos2d.cpp index 7c87f6b9f8..5dae6b8b59 100644 --- a/native/cocos/cocos2d.cpp +++ b/native/cocos/cocos2d.cpp @@ -32,7 +32,7 @@ NS_CC_BEGIN CC_DLL const char* cocos2dVersion() { - return "2.1.0"; + return "2.0.x"; } NS_CC_END diff --git a/native/cocos/platform/CCApplication.h b/native/cocos/platform/CCApplication.h index d920adee18..f0d6f96d94 100644 --- a/native/cocos/platform/CCApplication.h +++ b/native/cocos/platform/CCApplication.h @@ -179,6 +179,8 @@ public: */ bool openURL(const std::string &url); + void copyTextToClipboard(const std::string &text); + std::string getSystemVersion(); protected: diff --git a/native/cocos/platform/android/CCApplication-android.cpp b/native/cocos/platform/android/CCApplication-android.cpp index 868bb744d0..9389321794 100644 --- a/native/cocos/platform/android/CCApplication-android.cpp +++ b/native/cocos/platform/android/CCApplication-android.cpp @@ -257,6 +257,11 @@ bool Application::openURL(const std::string &url) return openURLJNI(url); } +void Application::copyTextToClipboard(const std::string &text) +{ + copyTextToClipboardJNI(text); +} + std::string Application::getSystemVersion() { return getSystemVersionJNI(); diff --git a/native/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java b/native/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java index b274cd70f6..0a31580366 100644 --- a/native/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java +++ b/native/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxHelper.java @@ -25,6 +25,8 @@ THE SOFTWARE. ****************************************************************************/ package org.cocos2dx.lib; +import android.content.ClipData; +import android.content.ClipboardManager; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; @@ -378,6 +380,18 @@ public class Cocos2dxHelper { } return ret; } + + // 复制文本到剪切板 + public static void copyTextToClipboard(final String text){ + sActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + ClipboardManager myClipboard = (ClipboardManager)sActivity.getSystemService(Context.CLIPBOARD_SERVICE); + ClipData myClip = ClipData.newPlainText("text", text); + myClipboard.setPrimaryClip(myClip); + } + }); + } public static long[] getObbAssetFileDescriptor(final String path) { long[] array = new long[3]; diff --git a/native/cocos/platform/android/jni/JniImp.cpp b/native/cocos/platform/android/jni/JniImp.cpp index 2dd14d1394..b86f0ec463 100644 --- a/native/cocos/platform/android/jni/JniImp.cpp +++ b/native/cocos/platform/android/jni/JniImp.cpp @@ -589,6 +589,11 @@ bool openURLJNI(const std::string& url) return JniHelper::callStaticBooleanMethod(JCLS_HELPER, "openURL", url); } +void copyTextToClipboardJNI(const std::string& text) +{ + JniHelper::callStaticVoidMethod(JCLS_HELPER, "copyTextToClipboard", text); +} + void setPreferredFramesPerSecondJNI(int fps) { JniHelper::callStaticVoidMethod(JCLS_RENDERER, "setPreferredFramesPerSecond", fps); diff --git a/native/cocos/platform/android/jni/JniImp.h b/native/cocos/platform/android/jni/JniImp.h index 10b65574b9..ac23548127 100644 --- a/native/cocos/platform/android/jni/JniImp.h +++ b/native/cocos/platform/android/jni/JniImp.h @@ -42,6 +42,7 @@ extern int getDeviceAudioBufferSizeInFramesJNI(); extern std::string getCurrentLanguageJNI(); extern std::string getSystemVersionJNI(); extern bool openURLJNI(const std::string& url); +extern void copyTextToClipboardJNI(const std::string& text); extern void setPreferredFramesPerSecondJNI(int fps); extern void setGameInfoDebugViewTextJNI(int index, const std::string& text); extern void setJSBInvocationCountJNI(int count); diff --git a/native/cocos/platform/ios/CCApplication-ios.mm b/native/cocos/platform/ios/CCApplication-ios.mm index a7c96376a3..fda6544ce4 100644 --- a/native/cocos/platform/ios/CCApplication-ios.mm +++ b/native/cocos/platform/ios/CCApplication-ios.mm @@ -352,6 +352,12 @@ bool Application::openURL(const std::string &url) return [[UIApplication sharedApplication] openURL:nsUrl]; } +void Application::copyTextToClipboard(const std::string &text) +{ + UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; + pasteboard.string = [NSString stringWithCString:text.c_str() encoding:NSUTF8StringEncoding]; +} + bool Application::applicationDidFinishLaunching() { return true; diff --git a/native/cocos/platform/mac/CCApplication-mac.mm b/native/cocos/platform/mac/CCApplication-mac.mm index 09e8c35b4f..d81d0f36fc 100644 --- a/native/cocos/platform/mac/CCApplication-mac.mm +++ b/native/cocos/platform/mac/CCApplication-mac.mm @@ -268,6 +268,14 @@ bool Application::openURL(const std::string &url) return [[NSWorkspace sharedWorkspace] openURL:nsUrl]; } +void Application::copyTextToClipboard(const std::string &text) +{ + NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; + [pasteboard clearContents]; + NSString* tmp = [NSString stringWithCString:text.c_str() encoding:NSUTF8StringEncoding]; + [pasteboard setString:tmp forType:NSStringPboardType]; +} + bool Application::applicationDidFinishLaunching() { return true; diff --git a/native/cocos/platform/win32/CCApplication-win32.cpp b/native/cocos/platform/win32/CCApplication-win32.cpp index a1c5eb383f..bf651db230 100644 --- a/native/cocos/platform/win32/CCApplication-win32.cpp +++ b/native/cocos/platform/win32/CCApplication-win32.cpp @@ -373,6 +373,11 @@ bool Application::openURL(const std::string &url) return (size_t)r>32; } +void Application::copyTextToClipboard(const std::string &text) +{ + //TODO +} + bool Application::applicationDidFinishLaunching() { return true; diff --git a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp index 6384b8a915..255caddf94 100644 --- a/native/cocos/scripting/js-bindings/manual/jsb_global.cpp +++ b/native/cocos/scripting/js-bindings/manual/jsb_global.cpp @@ -723,6 +723,39 @@ namespace bool freeData = false; }; + uint8_t* cvRGB2RGBA (uint32_t length, uint8_t* src) { + uint8_t* dst = new uint8_t[length]; + for (uint32_t i = 0; i < length; i += 4) { + dst[i] = *src++; + dst[i + 1] = *src++; + dst[i + 2] = *src++; + dst[i + 3] = 255; + } + return dst; + } + + uint8_t* cvIA2RGBA (uint32_t length, uint8_t* src) { + uint8_t* dst = new uint8_t[length]; + for (uint32_t i = 0; i < length; i += 4) { + dst[i] = *src; + dst[i + 1] = *src; + dst[i + 2] = *src++; + dst[i + 3] = *src; + } + return dst; + } + + uint8_t* cvI2RGBA (uint32_t length, uint8_t* src) { + uint8_t* dst = new uint8_t[length]; + for (uint32_t i = 0; i < length; i += 4) { + dst[i] = *src; + dst[i + 1] = *src; + dst[i + 2] = *src++; + dst[i + 3] = 255; + } + return dst; + } + struct ImageInfo* createImageInfo(const Image* img) { struct ImageInfo* imgInfo = new struct ImageInfo(); @@ -741,24 +774,33 @@ namespace imgInfo->hasAlpha = img->hasAlpha(); imgInfo->hasPremultipliedAlpha = img->hasPremultipliedAlpha(); imgInfo->compressed = img->isCompressed(); + imgInfo->length = img->getWidth() * img->getHeight() * 4; // Convert to RGBA888 because standard web api will return only RGBA888. // If not, then it may have issue in glTexSubImage. For example, engine // will create a big texture, and update its content with small pictures. // The big texture is RGBA888, then the small picture should be the same // format, or it will cause 0x502 error on OpenGL ES 2. - if (GL_RGB == imgInfo->glFormat) - { - imgInfo->length = img->getWidth() * img->getHeight() * 4; - uint8_t* dst = new uint8_t[imgInfo->length]; - uint8_t* src = imgInfo->data; - for (uint32_t i = 0, length = imgInfo->length; i < length; i += 4) - { - dst[i] = *src++; - dst[i + 1] = *src++; - dst[i + 2] = *src++; - dst[i + 3] = 255; - } + uint8_t* dst = nullptr; + uint32_t length = imgInfo->length; + uint8_t* src = imgInfo->data; + switch(imgInfo->glFormat) { + case GL_RGBA: break; + case GL_LUMINANCE_ALPHA: + dst = cvIA2RGBA(length, src); + break; + case GL_ALPHA: + case GL_LUMINANCE: + dst = cvI2RGBA(length, src); + break; + case GL_RGB: + dst = cvRGB2RGBA(length, src); + break; + default: + SE_LOGE("unknown image format"); + } + + if (imgInfo->glFormat != GL_RGBA) { imgInfo->data = dst; imgInfo->hasAlpha = true; imgInfo->bpp = 32; @@ -1009,6 +1051,24 @@ static bool JSB_openURL(se::State& s) } SE_BIND_FUNC(JSB_openURL) +static bool JSB_copyTextToClipboard(se::State& s) +{ + const auto& args = s.args(); + size_t argc = args.size(); + CC_UNUSED bool ok = true; + if (argc > 0) { + std::string text; + ok = seval_to_std_string(args[0], &text); + SE_PRECONDITION2(ok, false, "text is invalid!"); + Application::getInstance()->copyTextToClipboard(text); + return true; + } + + SE_REPORT_ERROR("wrong number of arguments: %d, was expecting %d", (int)argc, 1); + return false; +} +SE_BIND_FUNC(JSB_copyTextToClipboard) + static bool JSB_setPreferredFramesPerSecond(se::State& s) { const auto& args = s.args(); @@ -1146,6 +1206,8 @@ bool jsb_register_global_variables(se::Object* global) __jsbObj->defineFunction("openDebugView", _SE(js_openDebugView)); __jsbObj->defineFunction("disableBatchGLCommandsToNative", _SE(js_disableBatchGLCommandsToNative)); __jsbObj->defineFunction("openURL", _SE(JSB_openURL)); + __jsbObj->defineFunction("copyTextToClipboard", _SE(JSB_copyTextToClipboard)); + __jsbObj->defineFunction("setPreferredFramesPerSecond", _SE(JSB_setPreferredFramesPerSecond)); __jsbObj->defineFunction("showInputBox", _SE(JSB_showInputBox)); __jsbObj->defineFunction("hideInputBox", _SE(JSB_hideInputBox)); diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/app/build.gradle b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/app/build.gradle index 2444edbc03..f3e14e5a07 100755 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -99,28 +99,30 @@ android { android.applicationVariants.all { variant -> // delete previous files first - delete "${buildDir}/intermediates/assets/${variant.dirName}" + delete "${buildDir}/intermediates/merged_assets/${variant.dirName}" variant.mergeAssets.doLast { + def sourceDir = "${buildDir}/../../../../.." + copy { - from "${buildDir}/../../../../../res" - into "${buildDir}/intermediates/assets/${variant.dirName}/res" + from "${sourceDir}/res" + into "${outputDir}/res" } copy { - from "${buildDir}/../../../../../src" - into "${buildDir}/intermediates/assets/${variant.dirName}/src" + from "${sourceDir}/src" + into "${outputDir}/src" } copy { - from "${buildDir}/../../../../../jsb-adapter" - into "${buildDir}/intermediates/assets/${variant.dirName}/jsb-adapter" + from "${sourceDir}/jsb-adapter" + into "${outputDir}/jsb-adapter" } copy { - from "${buildDir}/../../../../../main.js" - from "${buildDir}/../../../../../project.json" - into "${buildDir}/intermediates/assets/${variant.dirName}" + from "${sourceDir}/main.js" + from "${sourceDir}/project.json" + into outputDir } } } diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/build.gradle b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/build.gradle index 2ed34062ce..e13c05adaa 100755 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/build.gradle +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/game/build.gradle b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/game/build.gradle index 4d4b600f57..918ab22d98 100644 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/game/build.gradle +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/game/build.gradle @@ -91,28 +91,30 @@ android { android.featureVariants.all { variant -> // delete previous files first - delete "${buildDir}/intermediates/assets/${variant.dirName}" + delete "${buildDir}/intermediates/merged_assets/${variant.dirName}" variant.mergeAssets.doLast { + def sourceDir = "${buildDir}/../../../../.." + copy { - from "${buildDir}/../../../../../res" - into "${buildDir}/intermediates/assets/${variant.dirName}/res" + from "${sourceDir}/res" + into "${outputDir}/res" } copy { - from "${buildDir}/../../../../../src" - into "${buildDir}/intermediates/assets/${variant.dirName}/src" + from "${sourceDir}/src" + into "${outputDir}/src" } copy { - from "${buildDir}/../../../../../jsb-adapter" - into "${buildDir}/intermediates/assets/${variant.dirName}/jsb-adapter" + from "${sourceDir}/jsb-adapter" + into "${outputDir}/jsb-adapter" } copy { - from "${buildDir}/../../../../../main.js" - from "${buildDir}/../../../../../project.json" - into "${buildDir}/intermediates/assets/${variant.dirName}" + from "${sourceDir}/main.js" + from "${sourceDir}/project.json" + into outputDir } } } diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle.properties b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle.properties index 42616f98de..0e6d187d15 100755 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle.properties +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle.properties @@ -27,7 +27,7 @@ PROP_MIN_SDK_VERSION=16 PROP_TARGET_SDK_VERSION=27 # Android Build Tools version that will be used as the compile project -PROP_BUILD_TOOLS_VERSION=27.0.3 +PROP_BUILD_TOOLS_VERSION=28.0.3 # List of CPU Archtexture to build that application with # Available architextures (armeabi-v7a | arm64-v8a | x86) diff --git a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties index 8a19b77f07..46f17a98ec 100755 --- a/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/native/templates/js-template-android-instant/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle index 7bbdd4740f..cbb8f0b115 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -99,28 +99,30 @@ android { android.applicationVariants.all { variant -> // delete previous files first - delete "${buildDir}/intermediates/assets/${variant.dirName}" + delete "${buildDir}/intermediates/merged_assets/${variant.dirName}" variant.mergeAssets.doLast { + def sourceDir = "${buildDir}/../../../../.." + copy { - from "${buildDir}/../../../../../res" - into "${buildDir}/intermediates/assets/${variant.dirName}/res" + from "${sourceDir}/res" + into "${outputDir}/res" } copy { - from "${buildDir}/../../../../../src" - into "${buildDir}/intermediates/assets/${variant.dirName}/src" + from "${sourceDir}/src" + into "${outputDir}/src" } copy { - from "${buildDir}/../../../../../jsb-adapter" - into "${buildDir}/intermediates/assets/${variant.dirName}/jsb-adapter" + from "${sourceDir}/jsb-adapter" + into "${outputDir}/jsb-adapter" } copy { - from "${buildDir}/../../../../../main.js" - from "${buildDir}/../../../../../project.json" - into "${buildDir}/intermediates/assets/${variant.dirName}" + from "${sourceDir}/main.js" + from "${sourceDir}/project.json" + into outputDir } } } diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle index f775b58e32..00164abed3 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties index b2a97f379b..57b89f5ea5 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle.properties @@ -27,7 +27,7 @@ PROP_MIN_SDK_VERSION=16 PROP_TARGET_SDK_VERSION=27 # Android Build Tools version that will be used as the compile project -PROP_BUILD_TOOLS_VERSION=27.0.3 +PROP_BUILD_TOOLS_VERSION=28.0.3 # List of CPU Archtexture to build that application with # Available architextures (armeabi-v7a | arm64-v8a | x86) diff --git a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties index 8a19b77f07..46f17a98ec 100755 --- a/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/native/templates/js-template-default/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/build.gradle b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/build.gradle index 83b7671a25..7c2f6a379b 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/build.gradle +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/app/build.gradle @@ -99,28 +99,30 @@ android { android.applicationVariants.all { variant -> // delete previous files first - delete "${buildDir}/intermediates/assets/${variant.dirName}" + delete "${buildDir}/intermediates/merged_assets/${variant.dirName}" variant.mergeAssets.doLast { + def sourceDir = "${buildDir}/../../../../.." + copy { - from "${buildDir}/../../../../../res" - into "${buildDir}/intermediates/assets/${variant.dirName}/res" + from "${sourceDir}/res" + into "${outputDir}/res" } copy { - from "${buildDir}/../../../../../src" - into "${buildDir}/intermediates/assets/${variant.dirName}/src" - } - - copy { - from "${buildDir}/../../../../../jsb-adapter" - into "${buildDir}/intermediates/assets/${variant.dirName}/jsb-adapter" + from "${sourceDir}/src" + into "${outputDir}/src" } copy { - from "${buildDir}/../../../../../main.js" - from "${buildDir}/../../../../../project.json" - into "${buildDir}/intermediates/assets/${variant.dirName}" + from "${sourceDir}/jsb-adapter" + into "${outputDir}/jsb-adapter" + } + + copy { + from "${sourceDir}/main.js" + from "${sourceDir}/project.json" + into outputDir } } } diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle index 223ef58c7c..a8d0fcfae8 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/build.gradle @@ -7,7 +7,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:3.2.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle.properties b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle.properties index 42616f98de..0e6d187d15 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle.properties +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle.properties @@ -27,7 +27,7 @@ PROP_MIN_SDK_VERSION=16 PROP_TARGET_SDK_VERSION=27 # Android Build Tools version that will be used as the compile project -PROP_BUILD_TOOLS_VERSION=27.0.3 +PROP_BUILD_TOOLS_VERSION=28.0.3 # List of CPU Archtexture to build that application with # Available architextures (armeabi-v7a | arm64-v8a | x86) diff --git a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties index 8a19b77f07..46f17a98ec 100755 --- a/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/native/templates/js-template-link/frameworks/runtime-src/proj.android-studio/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip diff --git a/native/tools/simulator/config.json b/native/tools/simulator/config.json index f864efad26..4e2a8510c7 100644 --- a/native/tools/simulator/config.json +++ b/native/tools/simulator/config.json @@ -13,54 +13,84 @@ }, "simulator_screen_size": [ { - "title": "iPhone 3Gs (480x320)", - "width": 480, - "height": 320 + "title": "Apple iPhone 5 (640x1136)", + "width": 640, + "height": 1136 }, { - "title": "iPhone 4 (960x640)", - "width": 960, - "height": 640 + "title": "Apple iPhone 6 (750x1334)", + "width": 750, + "height": 1334 }, { - "title": "iPhone 5 (1136x640)", - "width": 1136, - "height": 640 + "title": "Apple iPhone 6Plus (1242x2208)", + "width": 1242, + "height": 2208 }, { - "title": "iPhone 6 (1334x750)", - "width": 1334, - "height": 750 + "title": "Apple iPhone 7 (750x1334)", + "width": 750, + "height": 1334 }, { - "title": "iPhone 6 Plus (1920x1080)", - "width": 1920, - "height": 1080 + "title": "Apple iPhone 7Plus (1242x2208)", + "width": 1242, + "height": 2208 }, { - "title": "iPad (1024x768)", - "width": 1024, - "height": 768 + "title": "Apple iPhone X (750x2436)", + "width": 750, + "height": 2436 }, { - "title": "iPad Retina (2048x1536)", + "title": "Apple iPad (2048x1536)", "width": 2048, "height": 1536 }, { - "title": "Android (800x480)", - "width": 800, - "height": 480 + "title": "Apple iPad Air 2 (1536x2048)", + "width": 1536, + "height": 2048 }, { - "title": "Android (854x480)", - "width": 854, - "height": 480 + "title": "Apple iPad Pro 10.5-inch (1668x2224)", + "width": 1668, + "height": 2224 }, { - "title": "Android (1280x720)", + "title": "Apple iPad Pro 12.9-inch (2048x2732)", "width": 1280, - "height": 720 + "height": 2732 + }, + { + "title": "Huawei P9 (1080x1920)", + "width": 1080, + "height": 1920 + }, + { + "title": "Huawei Mate9 Pro (1440x2560)", + "width": 1440, + "height": 2560 + }, + { + "title": "Goolge Nexus 5 (1080x2880)", + "width": 1080, + "height": 2880 + }, + { + "title": "Goolge Nexus 5X (1079x1919)", + "width": 1079, + "height": 1919 + }, + { + "title": "Goolge Nexus 6 (1442x2562)", + "width": 1442, + "height": 2562 + }, + { + "title": "Goolge Nexus 7 (1920x1200)", + "width": 1920, + "height": 1200 } ] } diff --git a/native/tools/simulator/libsimulator/lib/ProjectConfig/SimulatorConfig.cpp b/native/tools/simulator/libsimulator/lib/ProjectConfig/SimulatorConfig.cpp index 65398ff795..fff5e4cd1b 100755 --- a/native/tools/simulator/libsimulator/lib/ProjectConfig/SimulatorConfig.cpp +++ b/native/tools/simulator/libsimulator/lib/ProjectConfig/SimulatorConfig.cpp @@ -40,20 +40,25 @@ SimulatorConfig *SimulatorConfig::getInstance() SimulatorConfig::SimulatorConfig() { - _screenSizeArray.push_back(SimulatorScreenSize("iPhone 3Gs (320x480)", 320, 480)); - _screenSizeArray.push_back(SimulatorScreenSize("iPhone 4 (640x960)", 640, 960)); - _screenSizeArray.push_back(SimulatorScreenSize("iPhone 5 (640x1136)", 640, 1136)); - _screenSizeArray.push_back(SimulatorScreenSize("iPhone 6 (750x1334)", 750, 1334)); - _screenSizeArray.push_back(SimulatorScreenSize("iPhone 6Plus (1242x2208)", 1242, 2208)); - _screenSizeArray.push_back(SimulatorScreenSize("iPad (768x1024)", 768, 1024)); - _screenSizeArray.push_back(SimulatorScreenSize("iPad Retina (1536x2048)", 1536, 2048)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (480x800)", 480, 800)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (480x854)", 480, 854)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (540x960)", 540, 960)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (600x1024)", 600, 1024)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (720x1280)", 720, 1280)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (800x1280)", 800, 1280)); - _screenSizeArray.push_back(SimulatorScreenSize("Android (1080x1920)", 1080, 1920)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone 5 (640x1136)", 640, 1136)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone 6 (750x1334)", 750, 1334)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone 6Plus (1242x2208)", 1242, 2208)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone 7 (750x1334)", 750, 1334)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone 7Plus (1242x2208)", 1242, 2208)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPhone X (750x2436)", 750, 2436)); + + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPad (2048x1536)", 2048, 1536)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPad Air 2 (1536x2048)", 1536, 2048)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPad Pro 10.5-inch (1668x2224)", 1668, 2224)); + _screenSizeArray.push_back(SimulatorScreenSize("Apple iPad Pro 12.9-inch (2048x2732)", 2048, 2732)); + + _screenSizeArray.push_back(SimulatorScreenSize("Huawei P9 (1080x1920)", 1080, 1920)); + _screenSizeArray.push_back(SimulatorScreenSize("Huawei Mate9 Pro (1440x2560)", 1440, 2560)); + + _screenSizeArray.push_back(SimulatorScreenSize("Goolge Nexus 5 (1080x2880)", 1080, 2880)); + _screenSizeArray.push_back(SimulatorScreenSize("Goolge Nexus 5X (1079x1919)", 1079, 1919)); + _screenSizeArray.push_back(SimulatorScreenSize("Goolge Nexus 6 (1442x2562)", 1442, 2562)); + _screenSizeArray.push_back(SimulatorScreenSize("Goolge Nexus 7 (1920x1200)", 1920, 1200)); } int SimulatorConfig::getScreenSizeCount() const