未验证 提交 ffd6f86a 编写于 作者: O openharmony_ci 提交者: Gitee

!9409 Navigation xts delete

Merge pull request !9409 from huangdong/navigation_delete
/*
* 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.
*/
@Entry
@Component
struct navigationType {
@State strokeWidthStr: string = '10px'
@State dividerColorStr: string = '#000000'
@State startMarginStr: string = '5px'
@State endMarginStr: string = '5px'
@State nullFlag: boolean = false
@State dividerColor: Color = Color.Red
private arr: number[] = [1, 2, 3];
normalIcon : Resource = $r("app.media.icon")
selectedIcon: Resource = $r("app.media.icon")
build() {
Column() {
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1600")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Auto)
.minContentWidth(50)
.navBarWidth(100)
.navBarWidthRange([50, 300])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1700")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Stack)
.minContentWidth(20000)
.navBarWidth(15000)
.navBarWidthRange([10000, 30000])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1800")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth(30)
.navBarWidth(100)
.navBarWidthRange([10, 20])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_1900")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.navBarWidth(100)
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_2000")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth(100)
.navBarWidth(100)
.navBarWidthRange([100, 100])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
Navigation() {
TextInput({ placeholder: 'search...' })
.width("90%")
.height(40)
.backgroundColor('#FFFFFF')
List({ space: 12 }) {
ForEach(this.arr, (item) => {
ListItem() {
NavRouter() {
Text("NavRouter" + item)
.width("100%")
.height(72)
.backgroundColor('#FFFFFF')
.borderRadius(24)
.fontSize(16)
.fontWeight(500)
.textAlign(TextAlign.Center)
NavDestination() {
Text("NavDestinationContent" + item)
}
.title("NavDestinationTitle" + item)
}
}
}, item => item)
}
.width("90%")
.margin({ top: 12 })
}.key("ArkUX_Navigation_2100")
.title("������������")
.titleMode(NavigationTitleMode.Mini)
.mode(NavigationMode.Split)
.minContentWidth("40%")
.navBarWidth("30%")
.navBarWidthRange(["20%", "50%"])
.menus([
{value: "", icon: "./image/ic_public_search.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}},
{value: "", icon: "./image/ic_public_add.svg", action: ()=> {}}
])
.toolBar({items: [
{value: "aas", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "bbbsdsdsdsdbb", icon: "./image/ic_public_highlights.svg", action: ()=> {}},
{value: "ccccassdsddcccc", icon: "./image/ic_public_highlights.svg", action: ()=> {}}
]})
}
.height('100%')
.width('100%')
.backgroundColor('#F1F3F5')
}
}
\ No newline at end of file
......@@ -32,7 +32,6 @@ import stageAnimatorTest from './stageAnimator.test';
import textSpanFontTest from './textSpanFont.test';
import gridScrollbarUpdateTest from './gridScrollbarUpdate.test';
import sidebarTypeTest from './sidebarType.test';
import navigationTypeTest from './navigationType.test';
import noBarrierComponentsTest from './noBarrierComponents.test';
import noBarriersGroupTest from './noBarriersGroup.test';
import assemblyCallbackTest from './assemblyCallback.test';
......@@ -62,7 +61,6 @@ export default function testsuite() {
textSpanFontTest()
gridScrollbarUpdateTest()
sidebarTypeTest()
navigationTypeTest()
noBarrierComponentsTest()
noBarriersGroupTest()
assemblyCallbackTest()
......
......@@ -170,7 +170,7 @@ export default function ActsgetcomponentTest() {
try{
let strJson = Utils.getComponentRect('ArkUX_Get_component_0060');
expect(parseInt(strJson.width)).assertEqual(126);
expect(parseInt(strJson.height)).assertEqual(36);
expect(parseInt(strJson.height)).assertEqual(60);
expect(parseInt(strJson.localOffsetX)).assertEqual(297);
expect(parseInt(strJson.localOffsetY)).assertEqual(2712);
expect(parseInt(strJson.windowOffsetX)).assertEqual(297);
......@@ -194,9 +194,9 @@ export default function ActsgetcomponentTest() {
expect(parseInt(strJson.width)).assertEqual(421);
expect(parseInt(strJson.height)).assertEqual(88);
expect(parseInt(strJson.localOffsetX)).assertEqual(149);
expect(parseInt(strJson.localOffsetY)).assertEqual(2748);
expect(parseInt(strJson.localOffsetY)).assertEqual(2772);
expect(parseInt(strJson.windowOffsetX)).assertEqual(149);
expect(parseInt(strJson.windowOffsetY)).assertEqual(2820);
expect(parseInt(strJson.windowOffsetY)).assertEqual(2844);
expect(parseInt(strJson.screenOffsetX)).assertEqual(149);
expect(parseInt(strJson.screenOffsetY)).assertEqual(149);
console.info('ArkUX_Get_component_0070 END ');
......@@ -216,9 +216,9 @@ export default function ActsgetcomponentTest() {
expect(parseInt(strJson.width)).assertEqual(648);
expect(parseInt(strJson.height)).assertEqual(450);
expect(parseInt(strJson.localOffsetX)).assertEqual(36);
expect(parseInt(strJson.localOffsetY)).assertEqual(2836);
expect(parseInt(strJson.localOffsetY)).assertEqual(2860);
expect(parseInt(strJson.windowOffsetX)).assertEqual(36);
expect(parseInt(strJson.windowOffsetY)).assertEqual(2908);
expect(parseInt(strJson.windowOffsetY)).assertEqual(2932);
expect(parseInt(strJson.screenOffsetX)).assertEqual(36);
expect(parseInt(strJson.screenOffsetY)).assertEqual(36);
console.info('ArkUX_Get_component_0080 END ');
......@@ -238,9 +238,9 @@ export default function ActsgetcomponentTest() {
expect(parseInt(strJson.width)).assertEqual(648);
expect(parseInt(strJson.height)).assertEqual(1136);
expect(parseInt(strJson.localOffsetX)).assertEqual(36);
expect(parseInt(strJson.localOffsetY)).assertEqual(3286);
expect(parseInt(strJson.localOffsetY)).assertEqual(3310);
expect(parseInt(strJson.windowOffsetX)).assertEqual(36);
expect(parseInt(strJson.windowOffsetY)).assertEqual(3358);
expect(parseInt(strJson.windowOffsetY)).assertEqual(3382);
expect(parseInt(strJson.screenOffsetX)).assertEqual(36);
expect(parseInt(strJson.screenOffsetY)).assertEqual(36);
console.info('ArkUX_Get_component_0090 END ');
......@@ -260,9 +260,9 @@ export default function ActsgetcomponentTest() {
expect(parseInt(strJson.width)).assertEqual(600);
expect(parseInt(strJson.height)).assertEqual(60);
expect(parseInt(strJson.localOffsetX)).assertEqual(60);
expect(parseInt(strJson.localOffsetY)).assertEqual(4452);
expect(parseInt(strJson.localOffsetY)).assertEqual(4476);
expect(parseInt(strJson.windowOffsetX)).assertEqual(60);
expect(parseInt(strJson.windowOffsetY)).assertEqual(4524);
expect(parseInt(strJson.windowOffsetY)).assertEqual(4548);
expect(parseInt(strJson.screenOffsetX)).assertEqual(60);
expect(parseInt(strJson.screenOffsetY)).assertEqual(60);
console.info('ArkUX_Get_component_0100 END ');
......
/*
* 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 router from '@system.router';
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "@ohos/hypium"
export default function navigationTypeTest() {
describe('navigationTypeTest', function () {
beforeEach(async function (done) {
console.info("flex beforeEach start");
let options = {
uri: 'TestAbility/pages/navigationType',
}
try {
router.clear();
let pages = router.getState();
console.info("get navigationType state success " + JSON.stringify(pages));
if (!("navigationType" == pages.name)) {
console.info("get navigationType state success " + JSON.stringify(pages.name));
let result = await router.push(options);
console.info("push navigationType page success " + JSON.stringify(result));
}
} catch (err) {
console.error("push navigationType page error: " + err);
}
done()
});
it('ArkUX_Navigation_1600', 0, async function (done) {
console.info('ArkUX_Navigation_1600 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1600');
console.info('ArkUX_Navigation_1600 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1600 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("50.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("50.00vp, 300.00vp");
console.info('ArkUX_Navigation_1600 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1600 ERR '+ JSON.stringify(err));
}
done();
},500)
})
it('ArkUX_Navigation_1700', 0, async function (done) {
console.info('ArkUX_Navigation_1700 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1700');
console.info('ArkUX_Navigation_1700 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1700 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.STACK");
expect(minContentWidth).assertEqual("20000.00vp");
expect(navBarWidth).assertEqual("15000.00vp");
expect(navBarWidthRange).assertEqual("10000.00vp, 30000.00vp");
console.info('ArkUX_Navigation_1700 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1700 ERR '+ JSON.stringify(err));
}
done();
},500)
})
it('ArkUX_Navigation_1800', 0, async function (done) {
console.info('ArkUX_Navigation_1800 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1800');
console.info('ArkUX_Navigation_1800 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1800 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("30.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("10.00vp, 20.00vp");
console.info('ArkUX_Navigation_1800 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1800 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_1900', 0, async function (done) {
console.info('ArkUX_Navigation_1900 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_1900');
console.info('ArkUX_Navigation_1900 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_1900 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("360.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("240.00vp, 432.00vp");
console.info('ArkUX_Navigation_1900 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_1900 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_2000', 0, async function (done) {
console.info('ArkUX_Navigation_2000 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_2000');
console.info('ArkUX_Navigation_2000 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_2000 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("100.00vp");
expect(navBarWidth).assertEqual("100.00vp");
expect(navBarWidthRange).assertEqual("100.00vp, 100.00vp");
console.info('ArkUX_Navigation_2000 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_2000 ERR '+ JSON.stringify(err));
}
done();
},500)
});
it('ArkUX_Navigation_2100', 0, async function (done) {
console.info('ArkUX_Navigation_2100 START');
setTimeout(()=>{
try{
let strJson = getInspectorByKey('ArkUX_Navigation_2100');
console.info('ArkUX_Navigation_2100 START :'+ JSON.stringify(strJson));
let obj = JSON.parse(strJson);
console.info("ArkUX_Navigation_2100 obj is: " + JSON.stringify(obj));
let mode = obj.$attrs.mode
let minContentWidth = obj.$attrs.minContentWidth
let navBarWidth = obj.$attrs.navBarWidth
let navBarWidthRange = obj.$attrs.navBarWidthRange
expect(mode).assertEqual("NavigationMode.SPLIT");
expect(minContentWidth).assertEqual("40.00%");
expect(navBarWidth).assertEqual("30.00%");
expect(navBarWidthRange).assertEqual("20.00%, 50.00%");
console.info('ArkUX_Navigation_2100 END ');
} catch(err) {
expect().assertFail()
console.info('ArkUX_Navigation_2100 ERR '+ JSON.stringify(err));
}
done();
},500)
});
});
};
\ No newline at end of file
......@@ -21,7 +21,6 @@
"TestAbility/pages/textSpanFont",
"TestAbility/pages/gridScrollBar",
"TestAbility/pages/sidebarType",
"TestAbility/pages/navigationType",
"TestAbility/pages/noBarrierComponents",
"TestAbility/pages/noBarriersGroup",
"TestAbility/pages/assemblyCallback",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册