Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
3f4555d1
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看板
提交
3f4555d1
编写于
7月 19, 2023
作者:
H
hekun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the code
Signed-off-by:
N
hekun
<
hekun18@huawei.com
>
上级
0bf882ff
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
135 addition
and
2 deletion
+135
-2
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
...lack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/GridColoffsetPage.ets
...ntry/src/main/ets/MainAbility/pages/GridColoffsetPage.ets
+59
-0
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridColoffsetJsunit.test.ets
...t_ui/entry/src/main/ets/test/GridColoffsetJsunit.test.ets
+71
-0
arkui/ace_ets_component_ui/entry/src/main/ets/test/List.test.ets
...ce_ets_component_ui/entry/src/main/ets/test/List.test.ets
+2
-0
arkui/ace_ets_component_ui/entry/src/main/resources/base/profile/main_pages.json
..._ui/entry/src/main/resources/base/profile/main_pages.json
+2
-1
未找到文件。
arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/lazyForEach.ets
浏览文件 @
3f4555d1
...
...
@@ -67,7 +67,7 @@ class BasicDataSource implements IDataSource {
}
class MyDataSource extends BasicDataSource {
private dataArray: string[] = ['/path/image0'
, '/path/image1', '/path/image2', '/path/image3'
]
private dataArray: string[] = ['/path/image0']
public totalCount(): number {
return this.dataArray.length
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/GridColoffsetPage.ets
0 → 100644
浏览文件 @
3f4555d1
/**
* Copyright (c) 2023 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 {MessageManager,Callback} from '../utils/MessageManager';
@Entry
@Component
struct GridColOffSetExample {
@State bgColors: Color[] = [Color.Red, Color.Orange, Color.Yellow, Color.Green, Color.Pink, Color.Grey, Color.Blue, Color.Brown]
@State currentBp: string = 'unknown'
@State gridColoffsetValue : number = -3;
messageManager:MessageManager = new MessageManager()
onPageShow() {
console.info('GridColOffset onPageShow')
globalThis.value = {
name:'messageManager',message:this.messageManager
}
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
if (message.name == 'gridColoffset') {
this.gridColoffsetValue = message.value
}
}
this.messageManager.registerCallback(callback)
}
build() {
Column() {
GridRow({
columns: 5,
gutter: { x: 5, y: 10 },
breakpoints: { value: ["400vp", "600vp", "800vp"],
reference: BreakpointsReference.WindowSize },
direction: GridRowDirection.Row
}) {
ForEach(this.bgColors, (color,index) => {
GridCol({ span: { xs: 1, sm: 2, md: 3, lg: 4 } }) {
Row().width("100%").height("20vp")
}.borderColor(color).borderWidth(2).gridColOffset(this.gridColoffsetValue).key('keykey'+index)
})
}.width("100%").height("100%")
.onBreakpointChange((breakpoint) => {
this.currentBp = breakpoint
})
}.width('80%').margin({ left: 10, top: 5, bottom: 5 }).height(200)
.border({ color: '#880606', width: 2 })
}
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridColoffsetJsunit.test.ets
0 → 100644
浏览文件 @
3f4555d1
/**
* Copyright (c) 2022 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium"
import router from '@system.router';
import {UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix} from '@ohos.UiTest';
import CommonFunc from '../MainAbility/utils/Common';
import {MessageManager,Callback} from '../MainAbility/utils/MessageManager';
export default function GridColOffsetJsunit() {
describe('GridColOffsetJsunit', function () {
beforeEach(async function (done) {
console.info("GridColOffsetJsunit beforeEach start");
let options = {
uri: 'MainAbility/pages/GridColoffsetPage',
}
try {
router.clear();
let pages = router.getState();
console.info("get GridColOffsetJsunit state pages: " + JSON.stringify(pages));
if (!("GridColoffsetPage" == pages.name)) {
console.info("get GridColOffsetJsunit state pages.name: " + JSON.stringify(pages.name));
let result = await router.push(options);
await CommonFunc.sleep(2000);
console.info("push GridColOffsetJsunit success: " + JSON.stringify(result));
}
} catch (err) {
console.error("push GridColOffsetJsunit page error: " + err);
expect().assertFail();
}
done();
});
it('GridColOffsetJsunit_0100', 0, async function (done) {
// Get the information of the GridCol component
let strJson = getInspectorByKey('keykey2');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('GridCol');
console.info("[GridColOffsetJsunit_0100] component strJson:" + JSON.stringify(obj.$attrs.gridColOffset));
expect(obj.$attrs.gridColOffset).assertEqual("0");
done();
});
it('GridColOffsetJsunit_0200', 0, async function (done) {
// Modify the properties of component GridCol
console.info('[GridColOffsetJsunit_0200] START');
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'gridColoffset',value:2});
await CommonFunc.sleep(200);
let strJson = getInspectorByKey('keykey2');
let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('GridCol');
console.info("[GridColOffsetJsunit_0100] component strJson:" + JSON.stringify(obj.$attrs.gridColOffset));
expect(obj.$attrs.gridColOffset).assertEqual("2");
done();
});
})
}
arkui/ace_ets_component_ui/entry/src/main/ets/test/List.test.ets
浏览文件 @
3f4555d1
...
...
@@ -55,6 +55,7 @@ import ToggleJsunit from './ToggleJsunit.test.ets';
import NavDestinationJsunit from './NavDestinationJsunit.test.ets';
import GridItemJsunit from './GridItemJsunit.test.ets';
import NavigationJsunit from './NavigationJsunit.test.ets';
import GridColOffsetJsunit from './GridColoffsetJsunit.test.ets';
export default function testsuite() {
blankJsunit();
...
...
@@ -99,4 +100,5 @@ export default function testsuite() {
NavDestinationJsunit();
GridItemJsunit();
NavigationJsunit();
GridColOffsetJsunit();
}
\ No newline at end of file
arkui/ace_ets_component_ui/entry/src/main/resources/base/profile/main_pages.json
浏览文件 @
3f4555d1
...
...
@@ -45,6 +45,7 @@
"MainAbility/pages/TogglePage"
,
"MainAbility/pages/NavDestinationPage"
,
"MainAbility/pages/NavigationPage"
,
"MainAbility/pages/GridItemPage"
"MainAbility/pages/GridItemPage"
,
"MainAbility/pages/GridColoffsetPage"
]
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录