mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
!39355 【基础能力】Drag CAPI 修复Badge Number的问题
Merge pull request !39355 from Zhang Jinyu/FixNumberBadgeEnabled
This commit is contained in:
commit
bd8e9b884a
@ -400,8 +400,8 @@ int32_t OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(ArkUI_DragPreviewOption
|
||||
return ARKUI_ERROR_CODE_PARAM_INVALID;
|
||||
}
|
||||
auto* options = reinterpret_cast<ArkUIDragPreViewAndInteractionOptions*>(option);
|
||||
options->isNumberBadgeEnabled = enabled;
|
||||
options->badgeNumber = static_cast<ArkUI_Int32>(enabled);
|
||||
options->isNumberBadgeEnabled = false;
|
||||
options->isShowBadge = enabled;
|
||||
return ARKUI_ERROR_CODE_NO_ERROR;
|
||||
}
|
||||
|
||||
@ -411,6 +411,7 @@ int32_t OH_ArkUI_DragPreviewOption_SetBadgeNumber(ArkUI_DragPreviewOption* optio
|
||||
return ARKUI_ERROR_CODE_PARAM_INVALID;
|
||||
}
|
||||
auto* options = reinterpret_cast<ArkUIDragPreViewAndInteractionOptions*>(option);
|
||||
options->isNumberBadgeEnabled = true;
|
||||
options->badgeNumber = static_cast<ArkUI_Int32>(forcedNumber);
|
||||
return ARKUI_ERROR_CODE_NO_ERROR;
|
||||
}
|
||||
|
@ -386,8 +386,8 @@ HWTEST_F(DragAndDropTest, DragAndDropTest012, TestSize.Level1)
|
||||
auto ret1 = OH_ArkUI_DragPreviewOption_SetNumberBadgeEnabled(dragPreviewOption, true);
|
||||
EXPECT_EQ(ret1, ARKUI_ERROR_CODE_NO_ERROR);
|
||||
auto* option = reinterpret_cast<ArkUIDragPreViewAndInteractionOptions*>(dragPreviewOption);
|
||||
EXPECT_TRUE(option->isNumberBadgeEnabled);
|
||||
EXPECT_EQ(option->badgeNumber, 1);
|
||||
EXPECT_FALSE(option->isNumberBadgeEnabled);
|
||||
EXPECT_TRUE(option->isShowBadge);
|
||||
|
||||
/**
|
||||
* @tc.steps: step2.set preview option with nullptr.
|
||||
@ -412,6 +412,7 @@ HWTEST_F(DragAndDropTest, DragAndDropTest013, TestSize.Level1)
|
||||
auto ret1 = OH_ArkUI_DragPreviewOption_SetBadgeNumber(dragPreviewOption, 2);
|
||||
EXPECT_EQ(ret1, ARKUI_ERROR_CODE_NO_ERROR);
|
||||
auto* option = reinterpret_cast<ArkUIDragPreViewAndInteractionOptions*>(dragPreviewOption);
|
||||
EXPECT_TRUE(option->isNumberBadgeEnabled);
|
||||
EXPECT_EQ(option->badgeNumber, 2);
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user