Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a953187b
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a953187b
编写于
10月 24, 2022
作者:
G
guoenquan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add arkui test
Signed-off-by:
N
guoenquan
<
guoenquan1@huawei-partners.com
>
上级
2eb5d0ba
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
1133 addition
and
170 deletion
+1133
-170
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/compomettestjs/CanvasRenderingContext2D/index.hml
...y/pages/compomettestjs/CanvasRenderingContext2D/index.hml
+8
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/compomettestjs/CanvasRenderingContext2D/index.js
...ty/pages/compomettestjs/CanvasRenderingContext2D/index.js
+25
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets
.../main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets
+250
-0
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets
...c/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets
+133
-46
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets
...main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets
+68
-68
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets
...in/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets
+21
-56
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets
...entry/src/main/ets/MainAbility/pages/conponentadd/web.ets
+628
-0
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/compomettestjs/CanvasRenderingContext2D/index.hml
浏览文件 @
a953187b
...
...
@@ -226,6 +226,14 @@
<text class="sub-title">
方法30
</text>
<canvas style="width: 100%; height: 60px;margin-top: 5px;" ref="function30"></canvas>
<text class="sub-title">
方法31
</text>
<canvas style="width: 100%; height: 60px;margin-top: 5px;" ref="function30"></canvas>
<text class="sub-title">
方法32
</text>
<canvas style="width: 100%; height: 60px;margin-top: 5px;" ref="function30"></canvas>
</div>
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/compomettestjs/CanvasRenderingContext2D/index.js
浏览文件 @
a953187b
...
...
@@ -398,6 +398,31 @@
ctx
.
rotateZ
(
10
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
},
functionTouch30
()
{
const
el
=
this
.
$refs
.
function15
;
const
ctx
=
el
.
getContext
(
'
2d
'
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
ctx
.
rotateZ
(
10
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
},
functionTouch31
()
{
let
mat
=
new
Matix2D
();
mat
.
multiply
();
let
stack
=
new
StackAttribute
();
stack
.
alignContent
();
const
el
=
this
.
$refs
.
function15
;
const
ctx
=
el
.
getContext
(
'
2d
'
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
ctx
.
multiply
();
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
},
functionTouch32
()
{
const
el
=
this
.
$refs
.
function15
;
const
ctx
=
el
.
getContext
(
'
2d
'
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
ctx
.
translateZ
(
50
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
},
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPrompt24.ets
0 → 100644
浏览文件 @
a953187b
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import prompt from '@ohos.prompt';
import promptAction from '@ohos.promptAction';
import events_emitter from '@ohos.events.emitter';
@Entry
@Component
struct promptExample {
@State text: string = 'item1'
@State color: string = '#000000'
build(){
Column(){
Button('showActionMenu')
.key('button1')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=>{
prompt.showActionMenu({
title: 'Title Info',
buttons: [
{
text: this.text,
color: this.color,
},
],
success: function(data) {
console.log('dialog success callback,click button : ' + data.tapIndex);
},
fail: function(data) {
console.log('dialog fail callback' + data.errMsg);
},
});
})
Button('showDialog')
.key('button2')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
prompt.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
{
text: this.text,
color: this.color,
},
],
success: function(data) {
console.log('dialog success callback,click button : ' + data.index);
},
cancel: function() {
console.log('dialog cancel callback');
},
});
})
Button('showActionMenu1')
.key('button3')
.backgroundColor('#ffe20b48')
.fontSize(20)
.margin({top: 20})
.onClick(()=>{
prompt.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
{
text: 'button1',
color: '#000000',
},
{
text: 'button2',
color: '#000000',
}
],
})
.then(data => {
Utils.emitEvent('sucessful',422)
console.info('showDialog success, click button: ' + data.index);
})
.catch(err => {
console.info('showDialog error: ' + err);
})
})
Button('showActionMenu2')
.key('button6')
.backgroundColor('#ffe20b48')
.fontSize(20)
.margin({top: 20})
.onClick(()=>{
prompt.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
})
Button('showDialog2')
.key('button5')
.backgroundColor('#ffe20b56')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
promptAction.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
{
text: this.text,
color: this.color,
},
],
})
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
Utils.emitEvent('sucessful',422)
})
.catch(data => {
console.info('showDialog error: ' + data.errMsg);
});
})
Button('showDialog2')
.key('button5')
.backgroundColor('#ffe20b56')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
try {
promptAction.showDialog({
title: 'showDialog Title Info',
message: 'Message Info',
buttons: [
{
text: 'button1',
color: '#000000',
},
{
text: 'button2',
color: '#000000',
}
]
}, (err, data) => {
if (err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
});
} catch (error) {
console.error(`showDialog args error code is ${error.code}, message is ${error.message}`);
};
})
Button('showDialog2')
.key('button5')
.backgroundColor('#ffe20b56')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
try {
promptAction.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
} catch (error) {
console.error(`showActionMenu args error code is ${error.code}, message is ${error.message}`);
};
})
Button('showDialog2')
.key('button5')
.backgroundColor('#ffe20b56')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
try {
promptAction.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
} catch (error) {
console.error(`showActionMenu args error code is ${error.code}, message is ${error.message}`);
};
})
}
}
}
\ No newline at end of file
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosPromptg.ets
浏览文件 @
a953187b
...
...
@@ -70,84 +70,171 @@ struct promptExample {
},
});
})
Button('showActionMenu1')
.key('button3')
.backgroundColor('#ffe20b48')
Button('protshowDialog')
.key('buttonp')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=>{
.onClick(()=>
{
prompt.showDialog({
title: 'Title Info',
message: 'Message Info',
buttons: [
{
text:
this.text
,
color:
this.color
,
text:
'button1'
,
color:
'#000000'
,
},
{
text: 'button2',
color: '#000000',
}
],
})
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
Utils.emitEvent('sucessful',422)
console.info('showDialog success, click button: ' + data.index);
})
.catch(data => {
console.info('showDialog error: ' + data.errMsg);
});
.catch(err => {
console.info('showDialog error: ' + err);
})
Button('showDialog1')
.key('button4')
.backgroundColor('#ffe20b56')
})
Button('protshowDialog')
.key('buttonp')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
prompt.showDialog({
title: 'Title Info',
title: '
showDialog
Title Info',
message: 'Message Info',
buttons: [
{
text:
this.text
,
color:
this.color
,
text:
'button1'
,
color:
'#000000'
,
},
],
{
text: 'button2',
color: '#000000',
}
]
}, (err, data) => {
if (err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
});
Button('protshowActionMenu1')
.key('buttons1')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
prompt.showActionMenu({
title: 'Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
}, (err, data) => {
if (err) {
console.info('showActionMenu err: ' + err);
return;
}
console.info('showActionMenu success callback, click button: ' + data.index);
});
Button('protshowActionMenu2')
.key('buttons2')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
.onClick(()=> {
prompt.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: 'item1',
color: '#666666',
},
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
Utils.emitEvent('sucessful',422)
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(data => {
console.info('showDialog error: ' + data.errMsg);
});
.catch(err => {
console.info('showActionMenu error: ' + err);
})
Button('showActionMenu2')
.key('button6')
.backgroundColor('#ffe20b48')
.fontSize(20)
.margin({top: 20})
})
in({top: 20})
.onClick(()=>{
promptAction.showDialog({
title: 'Title Info',
message: 'Message Info',
prompt.showActionMenu({
title: 'showActionMenu Title Info',
buttons: [
{
text: this.text
,
color: this.color
,
text: 'item1'
,
color: '#666666'
,
},
],
{
text: 'item2',
color: '#000000',
},
]
})
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
Utils.emitEvent('sucessful',422)
console.info('showActionMenu success, click button: ' + data.index);
})
.catch(err => {
console.info('showActionMenu error: ' + err);
})
.catch(data => {
console.info('showDialog error: ' + data.errMsg);
});
})
Button('showDialog2')
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets
浏览文件 @
a953187b
...
...
@@ -66,13 +66,13 @@ struct OhosRouterA {
data3: [123, 456, 789]
},
},
}, (err) => {
if (err) {
})
.then(() => {
// success
})
.catch(err => {
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('pushUrl success');
});
})
} catch (error) {
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
...
...
@@ -92,20 +92,20 @@ struct OhosRouterA {
data3: [123, 456, 789]
},
},
}, (err) => {
if (err) {
}, routery.RouterMode.Standard)
.then(() => {
// success
})
.catch(err => {
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('pushUrl success');
});
})
} catch (error) {
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
});
Button('replaceUr
l
')
.key('pushButtonA
1
')
Button('replaceUr
2
')
.key('pushButtonA
2
')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.margin({top: 20})
...
...
@@ -116,13 +116,13 @@ struct OhosRouterA {
params: {
data1: 'message',
},
}, routery.RouterMode.Standard, (err) => {
if (err) {
}, routery.RouterMode.Standard)
.then(() => {
// success
})
.catch(err => {
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
})
} catch (error) {
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
...
...
@@ -139,15 +139,15 @@ struct OhosRouterA {
params: {
data1: 'message',
},
}, (err) => {
if (err)
{
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success'
);
});
})
.then(() =>
{
// success
})
.catch(err => {
console.info(`replaceUrl failed, code is ${err.code}, message is ${err.message}`
);
})
} catch (error) {
console.error
(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
console.info
(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
});
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets
浏览文件 @
a953187b
...
...
@@ -23,73 +23,38 @@ struct ClipAndMaskExample {
@State isClipCircle:boolean = true;
@State maskType: CommonShapeMethod= new Rect({ width: 280, height: 280 });
@State clipType: CommonShapeMethod= new Circle({ width: 280, height: 280 });
@State shape_Type: CommonShapeMethod= new elliptical({ width: 200, height: 280 });
@State lengthType: CommonShapeMethod= new line({ width: 0, height: 10 });
@State pathType: CommonShapeMethod= new path({ width: 10, height: 10 });
@State shape_2_Type: CommonShapeMethod= new polygon({ width: 5, height: 10 });
@State shape_3_Type: CommonShapeMethod= new polyine({ width: 5, height: 10 });
@State shape_4_Type: CommonShapeMethod= new rect_({ width: 5, height: 10 ,radius : 5});
polygonInterface:PolygonInterface = Polygon
pathInterface : PathInterface = Path
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.maskType = new Circle({ width: 280, height: 280 });
}
}
}
shape:ShapeInterface = Shape
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.shape_Type = new elliptical({ width: 200, height: 280 });
}
}
}
rect: RectInterface = Rect
polylineInterface:PolylineInterface = Polyline
ellsple: EllipseAttribute = new Ellipse({
width:'150px',
height: '150px'
})
circle : CircleAttribute = new Circle({
width:'150px',
height: '150px'
})
line : LineAttribute = new Line({
width:'15px',
height: '15px'
})
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.lengthType = new line({ width: 200, height: 280 });
}
}
}
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.shape_4_Type = new rect_({ width: 200, height: 280 });
}
}
}
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.pathType = new path({ width: 200, height: 280 });
}
}
}
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.shape_2_Type = new polygon({ width: 200, height: 280 });
}
}
}
private stateChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
this.shape_3_Type = new polyine({ width: 200, height: 280 });
this.maskType = new Circle({ width: 280, height: 280 });
}
}
}
private shapeChangCallBack = (eventData) => {
if (eventData != null) {
console.info("shapeClipping page shape change called:" + JSON.stringify(eventData));
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets
0 → 100644
浏览文件 @
a953187b
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录