高级组件ComposeListItem蓝黄同步

Signed-off-by: zhangzuhui <zhangzuhui1@h-partners.com>

(cherry picked from commit e9057794c8)
Signed-off-by: zhangzuhui <zhangzuhui1@h-partners.com>
This commit is contained in:
zhangzuhui 2024-09-11 15:14:04 +08:00
parent 91b2db0cdc
commit 85a0117472
2 changed files with 39 additions and 12 deletions

View File

@ -85,6 +85,7 @@ const ICON_SIZE_MAP = new Map([
[IconType.LONGITUDINAL, LONGITUDINAL_SIZE],
[IconType.VERTICAL, VERTICAL_SIZE]
]);
class ContentItemStruct extends ViewPU {
constructor(a11, b11, c11, d11 = -1, e11 = undefined, f11) {
super(a11, c11, d11, f11);
@ -437,6 +438,7 @@ class ContentItemStruct extends ViewPU {
}
class CreateIconParam {
}
class OperateItemStruct extends ViewPU {
constructor(p8, q8, r8, s8 = -1, t8 = undefined, u8) {
super(p8, r8, s8, u8);
@ -1715,7 +1717,13 @@ export class ComposeListItem extends ViewPU {
minHeight: this.itemHeight
});
Flex.focusable(true);
Flex.borderRadius({ "id": -1, "type": 10002, params: ['sys.float.ohos_id_corner_radius_default_m'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" });
Flex.borderRadius({
"id": -1,
"type": 10002,
params: ['sys.float.ohos_id_corner_radius_default_m'],
"bundleName": "__harDefaultBundleName__",
"moduleName": "__harDefaultModuleName__"
});
Flex.backgroundColor(ObservedObject.GetRawObject(this.frontColor));
Flex.onFocus(() => {
this.canFocus = true;
@ -1740,14 +1748,26 @@ export class ComposeListItem extends ViewPU {
});
ViewStackProcessor.visualState("focused");
Flex.border({
radius: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_corner_radius_default_m'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
radius: {
"id": -1,
"type": 10002,
params: ['sys.float.ohos_id_corner_radius_default_m'],
"bundleName": "__harDefaultBundleName__",
"moduleName": "__harDefaultModuleName__"
},
width: ITEM_BORDER_SHOWN,
color: this.focusOutlineColor,
style: BorderStyle.Solid
});
ViewStackProcessor.visualState("normal");
Flex.border({
radius: { "id": -1, "type": 10002, params: ['sys.float.ohos_id_corner_radius_default_m'], "bundleName": "__harDefaultBundleName__", "moduleName": "__harDefaultModuleName__" },
radius: {
"id": -1,
"type": 10002,
params: ['sys.float.ohos_id_corner_radius_default_m'],
"bundleName": "__harDefaultBundleName__",
"moduleName": "__harDefaultModuleName__"
},
width: ITEM_BORDER_SHOWN,
color: Color.Transparent
});
@ -1786,10 +1806,14 @@ export class ComposeListItem extends ViewPU {
If.create();
if (this.contentItem !== null) {
this.ifElseBranchUpdateFunction(0, () => {
this.observeComponentCreation2((o1, p1) => {
__Common__.create();
__Common__.flexShrink(0);
}, __Common__);
{
this.observeComponentCreation2((z, f1) => {
if (f1) {
let t1 = new ContentItemStruct(this, {
this.observeComponentCreation2((d, o) => {
if (o) {
let p = new ContentItemStruct(this, {
icon: this.contentItem?.icon,
iconStyle: this.contentItem?.iconStyle,
primaryText: this.contentItem?.primaryText,
@ -1799,9 +1823,10 @@ export class ComposeListItem extends ViewPU {
fontSizeScale: this.fontSizeScale,
parentDirection: this.containerDirection,
itemDirection: this.contentItemDirection,
}, undefined, z, () => { }, { page: "library/src/main/ets/components/composelistitem.ets", line: 942, col: 11 });
ViewPU.create(t1);
let a4 = () => {
}, undefined, d, () => { },
{ page: 'library/src/main/ets/components/composelistitem.ets', line: 942, col: 11 });
ViewPU.create(p);
let t = () => {
return {
icon: this.contentItem?.icon,
iconStyle: this.contentItem?.iconStyle,
@ -1814,10 +1839,10 @@ export class ComposeListItem extends ViewPU {
itemDirection: this.contentItemDirection
};
};
t1.paramsGenerator_ = a4;
p.paramsGenerator_ = t;
}
else {
this.updateStateVarsOfChildByElmtId(z, {
this.updateStateVarsOfChildByElmtId(d, {
icon: this.contentItem?.icon,
iconStyle: this.contentItem?.iconStyle,
primaryText: this.contentItem?.primaryText,
@ -1831,6 +1856,7 @@ export class ComposeListItem extends ViewPU {
}
}, { name: "ContentItemStruct" });
}
__Common__.pop();
});
}
else {

View File

@ -593,7 +593,7 @@ struct OperateItemStruct {
@Builder
createTextArrow() {
Button({ type: ButtonType.Normal }) {
if(this.parentDirection === FlexDirection.Column) {
if (this.parentDirection === FlexDirection.Column) {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Text(this.text)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
@ -947,6 +947,7 @@ export struct ComposeListItem {
parentDirection: this.containerDirection,
itemDirection: this.contentItemDirection,
})
.flexShrink(0)
}
if (this.operateItem !== null) {
OperateItemStruct({