From 757bcf5f68ff58ebb62b786b3ff57770341af7c0 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 26 Sep 2023 20:04:43 +0800 Subject: [PATCH] =?UTF-8?q?android=20=E5=A2=9E=E5=8A=A0=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/advance/advance.vue | 15 +++++++++- .../uts-advance/utssdk/app-android/index.uts | 29 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/pages/advance/advance.vue b/pages/advance/advance.vue index c319bda..3f37c4e 100644 --- a/pages/advance/advance.vue +++ b/pages/advance/advance.vue @@ -24,7 +24,8 @@ clearIntervalTask, playAssetAudio, getMetaConfig, - quitApp + quitApp, + arrayConvert } from "../../uni_modules/uts-advance"; export default { @@ -89,6 +90,9 @@ }, { name: "退出当前应用", function: "testQuitApp" + },{ + name: "数组转换测试", + function: "testArrayConvert" }] }, { @@ -212,6 +216,15 @@ testQuitApp() { quitApp() }, + testArrayConvert() { + let convertRet = arrayConvert() + if(convertRet){ + uni.showToast({ + icon: "none", + title: '数组转换成功' + }); + } + }, testMetaRead() { let ret = getMetaConfig(); uni.showToast({ diff --git a/uni_modules/uts-advance/utssdk/app-android/index.uts b/uni_modules/uts-advance/utssdk/app-android/index.uts index 8f50709..0f8a2f5 100644 --- a/uni_modules/uts-advance/utssdk/app-android/index.uts +++ b/uni_modules/uts-advance/utssdk/app-android/index.uts @@ -506,4 +506,33 @@ export class User { } +export function arrayConvert():boolean{ + let b1 = byteArrayOf(-1,2,0,3,4,5) + let c1 = UTSArray.fromNative(b1) + if(!(c1 instanceof UTSArray)){ + return false + } + + + let b2 = longArrayOf(-1,2,0,3,4,5) + let c2 = UTSArray.fromNative(b2) + if(!(c2 instanceof UTSArray)){ + return false + } + + + let b3 = shortArrayOf(-1,2,0,3,4,5) + let c3 = UTSArray.fromNative(b3) + if(!(c3 instanceof UTSArray)){ + return false + } + + let b4 = intArrayOf(-1,2,0,3,4,5) + let c4 = UTSArray.fromNative(b4) + if(!(c4 instanceof UTSArray)){ + return false + } + + return true +} -- GitLab