dialog编码问题修复

Signed-off-by: zhangjing243 <zhangjing243@huawei.com>
This commit is contained in:
zhangjing243 2024-08-31 11:12:17 +08:00
parent e5df02defd
commit 8c706c171b
5 changed files with 13 additions and 11 deletions

View File

@ -902,8 +902,8 @@ var DialogAlignment;
let HoverModeAreaType;
(function (HoverModeAreaType) {
HoverModeAreaType[HoverModeAreaType["TOP_SCREEN"] = 0] = "TOP_SCREEN";
HoverModeAreaType[HoverModeAreaType["BOTTOM_SCREEN"] = 1] = "BOTTOM_SCREEN";
HoverModeAreaType.TOP_SCREEN = 0;
HoverModeAreaType.BOTTOM_SCREEN = 1;
})(HoverModeAreaType || (HoverModeAreaType = {}));
var DialogButtonStyle;

View File

@ -137,15 +137,13 @@ void DialogPattern::OnAttachToFrameNode()
void DialogPattern::RegisterHoverModeChangeCallback()
{
auto host = GetHost();
CHECK_NULL_VOID(host);
auto context = host->GetContext();
CHECK_NULL_VOID(context);
auto hoverModeChangeCallback = [weak = WeakClaim(this), context](bool isHalfFoldHover) {
auto hoverModeChangeCallback = [weak = WeakClaim(this)](bool isHalfFoldHover) {
auto pattern = weak.Upgrade();
CHECK_NULL_VOID(pattern);
auto host = pattern->GetHost();
CHECK_NULL_VOID(host);
auto context = host->GetContext();
CHECK_NULL_VOID(context);
AnimationOption optionPosition;
auto motion = AceType::MakeRefPtr<ResponsiveSpringMotion>(0.35f, 1.0f, 0.0f);
optionPosition.SetCurve(motion);
@ -155,6 +153,10 @@ void DialogPattern::RegisterHoverModeChangeCallback()
context->FlushUITasks();
});
};
auto host = GetHost();
CHECK_NULL_VOID(host);
auto context = host->GetContext();
CHECK_NULL_VOID(context);
auto hoverModeCallId = context->RegisterHalfFoldHoverChangedCallback(std::move(hoverModeChangeCallback));
UpdateHoverModeChangedCallbackId(hoverModeCallId);
}

View File

@ -35,7 +35,7 @@ struct PickerDialogInfo {
bool isStartDate;
bool isEndDate;
bool isSelectedDate;
bool enableHoverMode;
bool enableHoverMode = false;
std::optional<DialogAlignment> alignment;
std::optional<DimensionOffset> offset;
std::optional<DimensionRect> maskRect;

View File

@ -29,7 +29,7 @@ struct TextPickerDialog {
uint32_t selectedValue;
std::vector<std::string> getRangeVector;
bool isDefaultHeight;
bool enableHoverMode;
bool enableHoverMode = false;
std::optional<DialogAlignment> alignment;
std::optional<DimensionOffset> offset;
std::optional<DimensionRect> maskRect;

View File

@ -833,7 +833,7 @@ void GetNapiBlurStyleAndHoverModeProps(napi_env env, const std::shared_ptr<Promp
napi_typeof(env, asyncContext->backgroundBlurStyleApi, &blurStyleValueType);
if (blurStyleValueType == napi_number) {
int32_t num;
int32_t num = 0;
napi_get_value_int32(env, asyncContext->backgroundBlurStyleApi, &num);
if (num >= 0 && num < BG_BLUR_STYLE_MAX_INDEX) {
backgroundBlurStyle = num;
@ -843,7 +843,7 @@ void GetNapiBlurStyleAndHoverModeProps(napi_env env, const std::shared_ptr<Promp
napi_valuetype hoverModeValueType = napi_undefined;
napi_typeof(env, asyncContext->hoverModeAreaApi, &hoverModeValueType);
if (hoverModeValueType == napi_number) {
int32_t num;
int32_t num = 0;
napi_get_value_int32(env, asyncContext->hoverModeAreaApi, &num);
if (num >= 0 && num < static_cast<int32_t>(HOVER_MODE_AREA_TYPE.size())) {
hoverModeArea = HOVER_MODE_AREA_TYPE[num];