@@ -21,20 +21,14 @@ namespace rnoh {
21
21
progressNode.setLoadingProgressNodeColor (0x53658461 );
22
22
progressNode.setLoadingProgressNodeAnimating (true );
23
23
progressNode.setSize ({45 , 45 });
24
-
25
- imageStack = NativeNodeApi::getInstance ()->createNode (ARKUI_NODE_STACK);
26
-
24
+
27
25
ArkUI_NumberValue heightArray[] = {{.f32 = 45 }};
28
26
ArkUI_AttributeItem heightValue[] = {heightArray, 1 };
29
27
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_HEIGHT, heightValue);
30
28
ArkUI_NumberValue widthArray[] = {{.f32 = 45 }};
31
29
ArkUI_AttributeItem widthValue[] = {widthArray, 1 };
32
30
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_WIDTH, widthValue);
33
-
34
- ArkUI_NumberValue shadowArray[] = {{.i32 = ArkUI_ShadowStyle::ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG}};
35
- ArkUI_AttributeItem shadowValue[] = {shadowArray, 1 };
36
- NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_SHADOW, shadowValue);
37
-
31
+
38
32
ArkUI_NumberValue borderStyArray[] = {1 };
39
33
ArkUI_AttributeItem borderStyValue[] = {borderStyArray, 1 };
40
34
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_BORDER_WIDTH, borderStyValue);
@@ -48,13 +42,28 @@ namespace rnoh {
48
42
ArkUI_AttributeItem borderColorValue[] = {borderColorArray, 4 };
49
43
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_BORDER_COLOR, borderColorValue);
50
44
45
+ uint32_t shadowColorValue = 0xffaaaaaa ;
46
+ uint32_t alpha = static_cast <uint32_t >((float )(shadowColorValue >> 24 & (0xff ))*1.0 );
47
+ shadowColorValue = (alpha << 24 ) + (shadowColorValue & 0xffffff );
48
+ ArkUI_NumberValue shadowValue[] = {
49
+ {.f32 = 2 },
50
+ {.i32 = 0 },
51
+ {.f32 = 1 },
52
+ {.f32 = 1 },
53
+ {.i32 = 0 },
54
+ {.u32 = shadowColorValue},
55
+ {.u32 = 0 }
56
+ };
57
+ ArkUI_AttributeItem shadowItem[] = {.value = shadowValue,.size = sizeof (shadowValue)/sizeof (ArkUI_NumberValue)};
58
+ NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_CUSTOM_SHADOW, &shadowItem);
59
+
51
60
ArkUI_NumberValue z_indexArray[] = {{.f32 = 1000 }};
52
61
ArkUI_AttributeItem z_indexValue[] = {z_indexArray, 1 };
53
62
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_Z_INDEX, z_indexValue);
54
63
55
64
NativeNodeApi::getInstance ()->insertChildAt (imageStack, progressNode.getArkUINodeHandle (), 0 );
56
65
NativeNodeApi::getInstance ()->insertChildAt (arkUI_Node->getArkUINodeHandle (), imageStack, index);
57
- ArkUI_NumberValue positionArray[] = {{.f32 = static_cast <float >((screenWidth - 45 ) / 2.0 )}, {.f32 = -45 }};
66
+ ArkUI_NumberValue positionArray[] = {{.f32 = static_cast <float >((screenWidth - 46 ) / 2.0 )}, {.f32 = -46 }};
58
67
ArkUI_AttributeItem positionValue[] = {positionArray, 2 };
59
68
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_POSITION, positionValue);
60
69
}
@@ -63,7 +72,7 @@ namespace rnoh {
63
72
if (isRefreshed) {
64
73
return ;
65
74
}
66
- ArkUI_NumberValue positionArray[] = {{.f32 = static_cast <float >((mWindowWidth - 45 ) / 2.0 )}, {.f32 = dur - 45 }};
75
+ ArkUI_NumberValue positionArray[] = {{.f32 = static_cast <float >((mWindowWidth - 46 ) / 2.0 )}, {.f32 = dur - 46 }};
67
76
ArkUI_AttributeItem positionValue[] = {positionArray, 2 };
68
77
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_POSITION, positionValue);
69
78
}
@@ -102,8 +111,8 @@ namespace rnoh {
102
111
switch (status) {
103
112
case IS_FREE:
104
113
{
105
- float x = static_cast <float >((mWindowWidth - 45 ) / 2.0 );
106
- float y = -45 .0 ;
114
+ float x = static_cast <float >((mWindowWidth - 46 ) / 2.0 );
115
+ float y = -46 .0 ;
107
116
ArkUI_NumberValue positionArray[] = {{.f32 = x}, {.f32 = y}};
108
117
ArkUI_AttributeItem positionValue[] = {positionArray, 2 };
109
118
NativeNodeApi::getInstance ()->setAttribute (imageStack, NODE_POSITION, positionValue);
0 commit comments