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 @@
...
@@ -226,6 +226,14 @@
<text class="sub-title">
<text class="sub-title">
方法30
方法30
</text>
</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>
<canvas style="width: 100%; height: 60px;margin-top: 5px;" ref="function30"></canvas>
</div>
</div>
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/compomettestjs/CanvasRenderingContext2D/index.js
浏览文件 @
a953187b
...
@@ -398,6 +398,31 @@
...
@@ -398,6 +398,31 @@
ctx
.
rotateZ
(
10
);
ctx
.
rotateZ
(
10
);
ctx
.
fillRect
(
10
,
10
,
30
,
30
);
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 {
...
@@ -70,84 +70,171 @@ struct promptExample {
},
},
});
});
})
})
Button('showActionMenu1')
.key('button3')
Button('protshowDialog')
.backgroundColor('#ffe20b48')
.key('buttonp')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.fontSize(20)
.margin({top: 20})
.margin({top: 20})
.onClick(()=>{
.onClick(()=>
{
prompt.showDialog({
prompt.showDialog({
title: 'Title Info',
title: 'Title Info',
message: 'Message Info',
message: 'Message Info',
buttons: [
buttons: [
{
{
text:
this.text
,
text:
'button1'
,
color:
this.color
,
color:
'#000000'
,
},
},
{
text: 'button2',
color: '#000000',
}
],
],
})
})
.then(data => {
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
console.info('showDialog success, click button: ' + data.index);
Utils.emitEvent('sucessful',422)
})
.catch(err => {
console.info('showDialog error: ' + err);
})
})
.catch(data => {
console.info('showDialog error: ' + data.errMsg);
});
})
})
Button('
showDialog1
')
Button('
protshowDialog
')
.key('button
4
')
.key('button
p
')
.backgroundColor('#
ffe20b56
')
.backgroundColor('#
FF0B8FE2
')
.fontSize(20)
.fontSize(20)
.margin({top: 20})
.margin({top: 20})
.onClick(()=> {
.onClick(()=> {
prompt.showDialog({
prompt.showDialog({
title: 'Title Info',
title: '
showDialog
Title Info',
message: 'Message Info',
message: 'Message Info',
buttons: [
buttons: [
{
{
text:
this.text
,
text:
'button1'
,
color:
this.color
,
color:
'#000000'
,
},
},
],
{
})
text: 'button2',
.then(data => {
color: '#000000',
console.info('showDialog success, click button: ' + data.tapIndex);
}
Utils.emitEvent('sucessful',422)
]
}, (err, data) => {
if (err) {
console.info('showDialog err: ' + err);
return;
}
console.info('showDialog success callback, click button: ' + data.index);
});
})
Button('protshowActionMenu1')
.catch(data => {
.key('buttons1')
console.info('showDialog error: ' + data.errMsg);
.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('showActionMenu2')
Button('
prot
showActionMenu2')
.key('button
6
')
.key('button
s2
')
.backgroundColor('#
ffe20b48
')
.backgroundColor('#
FF0B8FE2
')
.fontSize(20)
.fontSize(20)
.margin({top: 20})
.margin({top: 20})
.onClick(()=>{
.onClick(()=> {
promptAction.showDialog({
prompt.showActionMenu({
title: 'Title Info',
title: 'showActionMenu Title Info',
message: 'Message Info',
buttons: [
buttons: [
{
{
text:
this.text
,
text:
'item1'
,
color:
this.color
,
color:
'#666666'
,
},
},
],
{
text: 'item2',
color: '#000000',
},
]
})
})
.then(data => {
.then(data => {
console.info('showDialog success, click button: ' + data.tapIndex);
console.info('showActionMenu success, click button: ' + data.index);
Utils.emitEvent('sucessful',422)
})
})
.catch(data => {
.catch(err => {
console.info('showDialog error: ' + data.errMsg);
console.info('showActionMenu error: ' + err);
});
})
})
in({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')
Button('showDialog2')
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/ohosRouterA_y.ets
浏览文件 @
a953187b
...
@@ -58,24 +58,24 @@ struct OhosRouterA {
...
@@ -58,24 +58,24 @@ struct OhosRouterA {
.margin({top: 20})
.margin({top: 20})
.onClick(() => {
.onClick(() => {
try {
try {
routery.pushUrl({
routery.pushUrl({
url: 'pages/routerpage2',
url: 'pages/routerpage2',
params: {
params: {
data1: 'message',
data1: 'message',
data2: {
data2: {
data3: [123, 456, 789]
data3: [123, 456, 789]
},
},
},
},
}, (err) => {
})
if (err)
{
.then(() =>
{
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
// success
return;
})
}
.catch(err => {
console.info('pushUrl success'
);
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`
);
});
})
} catch (error) {
} catch (error) {
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
};
});
});
Button('pushUrl')
Button('pushUrl')
.key('pushButtonA1')
.key('pushButtonA1')
...
@@ -84,48 +84,48 @@ struct OhosRouterA {
...
@@ -84,48 +84,48 @@ struct OhosRouterA {
.margin({top: 20})
.margin({top: 20})
.onClick(() => {
.onClick(() => {
try {
try {
routery.pushUrl({
routery.pushUrl({
url: 'pages/routerpage2',
url: 'pages/routerpage2',
params: {
params: {
data1: 'message',
data1: 'message',
data2: {
data2: {
data3: [123, 456, 789]
data3: [123, 456, 789]
},
},
},
},
}, (err) => {
}, routery.RouterMode.Standard)
if (err)
{
.then(() =>
{
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
// success
return;
})
}
.catch(err => {
console.info('pushUrl success'
);
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`
);
});
})
} catch (error) {
} catch (error) {
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
};
});
});
Button('replaceUr
l
')
Button('replaceUr
2
')
.key('pushButtonA
1
')
.key('pushButtonA
2
')
.backgroundColor('#FF0B8FE2')
.backgroundColor('#FF0B8FE2')
.fontSize(20)
.fontSize(20)
.margin({top: 20})
.margin({top: 20})
.onClick(() => {
.onClick(() => {
try {
try {
routery.replaceUrl({
routery.replaceUrl({
url: 'pages/detail',
url: 'pages/detail',
params: {
params: {
data1: 'message',
data1: 'message',
},
},
}, routery.RouterMode.Standard, (err) => {
}, routery.RouterMode.Standard)
if (err)
{
.then(() =>
{
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
// success
return;
})
}
.catch(err => {
console.info('replaceUrl success'
);
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`
);
});
})
} catch (error) {
} catch (error) {
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
};
});
});
Button('replaceUrl')
Button('replaceUrl')
.key('pushButtonA1')
.key('pushButtonA1')
...
@@ -134,21 +134,21 @@ struct OhosRouterA {
...
@@ -134,21 +134,21 @@ struct OhosRouterA {
.margin({top: 20})
.margin({top: 20})
.onClick(() => {
.onClick(() => {
try {
try {
routery.replaceUrl({
routery.replaceUrl({
url: 'pages/detail',
url: 'pages/detail',
params: {
params: {
data1: 'message',
data1: 'message',
},
},
}, (err) => {
})
if (err)
{
.then(() =>
{
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
// success
return;
})
}
.catch(err => {
console.info('replaceUrl success'
);
console.info(`replaceUrl failed, code is ${err.code}, message is ${err.message}`
);
});
})
} catch (error) {
} 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}`);
};
};
});
});
Button('clear')
Button('clear')
...
...
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/shapeClipping_y.ets
浏览文件 @
a953187b
...
@@ -23,73 +23,38 @@ struct ClipAndMaskExample {
...
@@ -23,73 +23,38 @@ struct ClipAndMaskExample {
@State isClipCircle:boolean = true;
@State isClipCircle:boolean = true;
@State maskType: CommonShapeMethod= new Rect({ width: 280, height: 280 });
@State maskType: CommonShapeMethod= new Rect({ width: 280, height: 280 });
@State clipType: CommonShapeMethod= new Circle({ width: 280, height: 280 });
@State clipType: CommonShapeMethod= new Circle({ width: 280, height: 280 });
@State shape_Type: CommonShapeMethod= new elliptical({ width: 200, height: 280 });
polygonInterface:PolygonInterface = Polygon
@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});
pathInterface : PathInterface = Path
private stateChangCallBack = (eventData) => {
shape:ShapeInterface = Shape
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 });
}
}
}
private stateChangCallBack = (eventData) => {
rect: RectInterface = Rect
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 });
}
}
}
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) => {
private stateChangCallBack = (eventData) => {
if (eventData != null) {
if (eventData != null) {
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
console.info("shapeClipping page state change called:" + JSON.stringify(eventData));
if(eventData.data.maskValue != null) {
if(eventData.data.maskValue != null) {
this.lengthType = new line({ width: 200, height: 280 });
this.maskType = new Circle({ width: 280, 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 });
}
}
}
}
}
}
private shapeChangCallBack = (eventData) => {
private shapeChangCallBack = (eventData) => {
if (eventData != null) {
if (eventData != null) {
console.info("shapeClipping page shape change called:" + JSON.stringify(eventData));
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录