Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
Hello UTS
提交
4331efc8
H
Hello UTS
项目概览
DCloud
/
Hello UTS
通知
1595
Star
27
Fork
9
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
Hello UTS
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4331efc8
编写于
6月 26, 2024
作者:
杜庆泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复部分编译警告
上级
6a6d410f
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
21 addition
and
17 deletion
+21
-17
uni_modules/uts-advance/utssdk/app-android/index.uts
uni_modules/uts-advance/utssdk/app-android/index.uts
+12
-9
uni_modules/uts-api-test/utssdk/app-android/index.uts
uni_modules/uts-api-test/utssdk/app-android/index.uts
+4
-4
uni_modules/uts-nativepage/utssdk/app-android/index.uts
uni_modules/uts-nativepage/utssdk/app-android/index.uts
+2
-1
uni_modules/uts-tests/utssdk/Array.uts
uni_modules/uts-tests/utssdk/Array.uts
+1
-1
uni_modules/uts-tests/utssdk/Date.uts
uni_modules/uts-tests/utssdk/Date.uts
+2
-2
未找到文件。
uni_modules/uts-advance/utssdk/app-android/index.uts
浏览文件 @
4331efc8
...
@@ -228,6 +228,7 @@ export function stopAssetAudio() {
...
@@ -228,6 +228,7 @@ export function stopAssetAudio() {
}
}
@Suppress("DEPRECATION")
export function goOtherActivity(imageDone : (event : string) => void) : boolean {
export function goOtherActivity(imageDone : (event : string) => void) : boolean {
// 检查相关权限是否已经具备
// 检查相关权限是否已经具备
...
@@ -238,12 +239,14 @@ export function goOtherActivity(imageDone : (event : string) => void) : boolean
...
@@ -238,12 +239,14 @@ export function goOtherActivity(imageDone : (event : string) => void) : boolean
return false;
return false;
}
}
UTSAndroid.onAppActivityResult((requestCode : Int, resultCode : Int, data ?: Intent) => {
UTSAndroid.onAppActivityResult((requestCode : Int, resultCode : Int, data ?: Intent) => {
let eventName = "onAppActivityResult - requestCode:" + requestCode + " -resultCode:" + resultCode + " -data:" + JSON.stringify(data);
let eventName = "onAppActivityResult - requestCode:" + requestCode + " -resultCode:" + resultCode + " -data:" + JSON.stringify(data);
console.log(eventName);
console.log(eventName);
if ((requestCode == 1001) && (resultCode == Activity.RESULT_OK)) {
if ((requestCode == 1001) && (resultCode == Activity.RESULT_OK)) {
if (data != null) {
if (data != null) {
let bundle = data.getExtras();
let bundle = data.getExtras();
let mImageBitmap = bundle!.get("data") as Bitmap;
let mImageBitmap = bundle!.get("data") as Bitmap;
let bitmapPath = UTSAndroid.getUniActivity()!.getExternalCacheDir()!.getPath() + "/photo.png"
let bitmapPath = UTSAndroid.getUniActivity()!.getExternalCacheDir()!.getPath() + "/photo.png"
console.log(bitmapPath);
console.log(bitmapPath);
...
@@ -465,7 +468,7 @@ export function arrayConvert():boolean{
...
@@ -465,7 +468,7 @@ export function arrayConvert():boolean{
let kotlinList = mutableListOf("hello","world")
let kotlinList = mutableListOf("hello","world")
let utsArr1 = Array.fromNative(kotlinList)
let utsArr1 = Array.fromNative(kotlinList)
if(
!(utsArr1 instanceof UTSArray<string>)
){
if(
utsArr1[0] != "hello"
){
return false
return false
}
}
...
@@ -473,37 +476,36 @@ export function arrayConvert():boolean{
...
@@ -473,37 +476,36 @@ export function arrayConvert():boolean{
let kotlinArray = arrayOf("hello","world")
let kotlinArray = arrayOf("hello","world")
let utsArr2 = Array.fromNative(kotlinArray)
let utsArr2 = Array.fromNative(kotlinArray)
if(
!(utsArr2 instanceof UTSArray<string>)
){
if(
utsArr2[0] != "hello"
){
return false
return false
}
}
let b1 = byteArrayOf(-1,2,0,3,4,5)
let b1 = byteArrayOf(-1,2,0,3,4,5)
let c1 = Array.fromNative(b1)
let c1 = Array.fromNative(b1)
if(!(c1 instanceof UTSArray<Number>)){
if(c1[0] != (-1 as Number).toByte()){
return false
return false
}
}
let b2 = longArrayOf(-1,2,0,3,4,5)
let b2 = longArrayOf(-1,2,0,3,4,5)
let c2 = Array.fromNative(b2)
let c2 = Array.fromNative(b2)
if(
!(c2 instanceof UTSArray<Number>
)){
if(
c2[0] != (-1 as Number).toLong(
)){
return false
return false
}
}
let b3 = shortArrayOf(-1,2,0,3,4,5)
let b3 = shortArrayOf(-1,2,0,3,4,5)
let c3 = Array.fromNative(b3)
let c3 = Array.fromNative(b3)
if(
!(c3 instanceof UTSArray<Number>
)){
if(
c3[0] != (-1 as Number).toShort(
)){
return false
return false
}
}
let b4 = intArrayOf(-1,2,0,3,4,5)
let b4 = intArrayOf(-1,2,0,3,4,5)
let c4 = Array.fromNative(b4)
let c4 = Array.fromNative(b4)
if(
!(c4 instanceof UTSArray<Number>
)){
if(
c4[0] != (-1 as Number).toInt(
)){
return false
return false
}
}
return true
return true
}
}
...
@@ -513,7 +515,8 @@ export function openFileWithProvider(url:String){
...
@@ -513,7 +515,8 @@ export function openFileWithProvider(url:String){
const uri = UTSAndroid.getFileProviderUri(file)
const uri = UTSAndroid.getFileProviderUri(file)
console.log("uri",uri.toString())
console.log("uri",uri.toString())
const intent = new Intent(Intent.ACTION_VIEW, uri)
const intent = new Intent(Intent.ACTION_VIEW, uri)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) // 添加权限标志
// 添加权限标志
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
const context = UTSAndroid.getUniActivity()!;
const context = UTSAndroid.getUniActivity()!;
context.startActivity(intent);
context.startActivity(intent);
}
}
uni_modules/uts-api-test/utssdk/app-android/index.uts
浏览文件 @
4331efc8
...
@@ -45,10 +45,10 @@ export function frequentlyObjectTest():boolean{
...
@@ -45,10 +45,10 @@ export function frequentlyObjectTest():boolean{
console.log(typeLogRet)
console.log(typeLogRet)
let typeLogObj = JSON.parseObject(typeLogRet)!
let typeLogObj = JSON.parseObject(typeLogRet)!
//
let typeLogObjPos = typeLogObj.getJSON("__$originalPosition")!
let typeLogObjPos = typeLogObj.getJSON("__$originalPosition")!
//
if("ParamOptions" != typeLogObjPos['name']){
if("ParamOptions" != typeLogObjPos['name']){
//
return false
return false
//
}
}
// /**
// /**
// * 编译出来的位置信息可能有差异,排除单独验证后,排除掉这个字段
// * 编译出来的位置信息可能有差异,排除单独验证后,排除掉这个字段
// */
// */
...
...
uni_modules/uts-nativepage/utssdk/app-android/index.uts
浏览文件 @
4331efc8
...
@@ -75,7 +75,7 @@ export class AppHookProxy implements UTSAndroidHookProxy {
...
@@ -75,7 +75,7 @@ export class AppHookProxy implements UTSAndroidHookProxy {
}
}
@Suppress("DEPRECATION")
class ForeService extends Service {
class ForeService extends Service {
constructor (){
constructor (){
...
@@ -130,6 +130,7 @@ class ForeService extends Service {
...
@@ -130,6 +130,7 @@ class ForeService extends Service {
return super.onStartCommand(intent, flags, startId);
return super.onStartCommand(intent, flags, startId);
}
}
override onDestroy():void {
override onDestroy():void {
super.onDestroy();
super.onDestroy();
this.stopForeground(true);// 停止前台服务--参数:表示是否移除之前的通知
this.stopForeground(true);// 停止前台服务--参数:表示是否移除之前的通知
...
...
uni_modules/uts-tests/utssdk/Array.uts
浏览文件 @
4331efc8
...
@@ -187,7 +187,7 @@ export function testArray(): Result {
...
@@ -187,7 +187,7 @@ export function testArray(): Result {
// #ifndef APP-IOS
// #ifndef APP-IOS
const s = JSON.parse<P[]>(JSON.stringify([{ x: 0, y: 0 }])) as P[]
const s = JSON.parse<P[]>(JSON.stringify([{ x: 0, y: 0 }])) as P[]
s[0].x += 0;
s[0].x += 0;
const clearList = s.map((v : P, _, _
a
) : number => v.x)
const clearList = s.map((v : P, _, _) : number => v.x)
expect(clearList.includes(0)).toEqual(true);
expect(clearList.includes(0)).toEqual(true);
// #endif
// #endif
// #ifdef APP-IOS
// #ifdef APP-IOS
...
...
uni_modules/uts-tests/utssdk/Date.uts
浏览文件 @
4331efc8
...
@@ -36,11 +36,11 @@ export function testDate() : Result {
...
@@ -36,11 +36,11 @@ export function testDate() : Result {
const date1 = new Date('01 Jan 1970 00:00:00 GMT');
const date1 = new Date('01 Jan 1970 00:00:00 GMT');
const date2 = new Date('December 17, 1995 03:24:00');
const date2 = new Date('December 17, 1995 03:24:00');
// #if
n
def APP-IOS
// #ifdef APP-IOS
expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800 (中国标准时间)");
expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800 (中国标准时间)");
expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800 (中国标准时间)");
expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800 (中国标准时间)");
// #endif
// #endif
// #if
n
def APP-ANDROID
// #ifdef APP-ANDROID
expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800");
expect(date1.toTimeString()).toEqual("08:00:00 GMT+0800");
expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800");
expect(date2.toTimeString()).toEqual("03:24:00 GMT+0800");
// #endif
// #endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录