From 9d01dd815c68d48f87deb72029d1f9c2de96ad54 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 26 Sep 2023 20:22:44 +0800 Subject: [PATCH] =?UTF-8?q?android=20=E6=95=B0=E7=BB=84=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uts-advance/utssdk/app-android/index.uts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/uni_modules/uts-advance/utssdk/app-android/index.uts b/uni_modules/uts-advance/utssdk/app-android/index.uts index 1169d57..6febb54 100644 --- a/uni_modules/uts-advance/utssdk/app-android/index.uts +++ b/uni_modules/uts-advance/utssdk/app-android/index.uts @@ -507,6 +507,23 @@ export class User { export function arrayConvert():boolean{ + + // kotlin.collections.List 转换 Array + let kotlinList = mutableListOf("hello","world") + let utsArr1 = Array.fromNative(kotlinList) + + if(!(utsArr1 instanceof UTSArray)){ + return false + } + + // kotlin.Array 转换 Array + let kotlinArray = arrayOf("hello","world") + let utsArr2 = Array.fromNative(kotlinArray) + + if(!(utsArr2 instanceof UTSArray)){ + return false + } + let b1 = byteArrayOf(-1,2,0,3,4,5) let c1 = Array.fromNative(b1) if(!(c1 instanceof UTSArray)){ @@ -533,6 +550,7 @@ export function arrayConvert():boolean{ return false } + return true } -- GitLab