已合并
ArkWeb 解决拉起键盘时旋转屏幕键盘不避让问题 #38408
zhufenghao创建于 2024年7月22日
ArkWeb 解决拉起键盘时旋转屏幕键盘不避让问题 #38408
已合并
从refs/pull/38408/head合入到master
共 1 个文件变更+3-4
| @@ -2553,7 +2553,7 @@ void WebPattern::InitInOfflineMode() | |||
| 2553 | Offset offset = Offset(0, 0); | 2553 | Offset offset = Offset(0, 0); |
| 2554 | TAG_LOGD(AceLogTag::ACE_WEB, "InitInOfflineMode drawsize_ : %{public}s", drawSize_.ToString().c_str()); | 2554 | TAG_LOGD(AceLogTag::ACE_WEB, "InitInOfflineMode drawsize_ : %{public}s", drawSize_.ToString().c_str()); |
| 2555 | delegate_->SetBoundsOrResize(drawSize, offset); | 2555 | delegate_->SetBoundsOrResize(drawSize, offset); |
| 2556 | - | 2556 | + |
| 2557 | if (!isUrlLoaded_) { | 2557 | if (!isUrlLoaded_) { |
| 2558 | isUrlLoaded_ = true; | 2558 | isUrlLoaded_ = true; |
| 2559 | if (webSrc_) { | 2559 | if (webSrc_) { |
| @@ -2627,6 +2627,7 @@ bool WebPattern::ProcessVirtualKeyBoardShow(int32_t width, int32_t height, doubl | |||
| 2627 | } | 2627 | } |
| 2628 | if (height - GetCoordinatePoint()->GetY() < keyboard) { | 2628 | if (height - GetCoordinatePoint()->GetY() < keyboard) { |
| 2629 | TAG_LOGI(AceLogTag::ACE_WEB, "ProcessVirtualKeyBoardShow Complete occlusion"); | 2629 | TAG_LOGI(AceLogTag::ACE_WEB, "ProcessVirtualKeyBoardShow Complete occlusion"); |
| 2630 | + isVirtualKeyBoardShow_ = VkState::VK_SHOW; | ||
| 2630 | return true; | 2631 | return true; |
| 2631 | } | 2632 | } |
| 2632 | if (!delegate_->NeedSoftKeyboard()) { | 2633 | if (!delegate_->NeedSoftKeyboard()) { |
| @@ -2684,10 +2685,8 @@ bool WebPattern::ProcessVirtualKeyBoard(int32_t width, int32_t height, double ke | |||
| 2684 | UpdateOnFocusTextField(!NearZero(keyboard)); | 2685 | UpdateOnFocusTextField(!NearZero(keyboard)); |
| 2685 | if (NearZero(keyboard)) { | 2686 | if (NearZero(keyboard)) { |
| 2686 | return ProcessVirtualKeyBoardHide(width, height, keyboardSafeAreaEnabled); | 2687 | return ProcessVirtualKeyBoardHide(width, height, keyboardSafeAreaEnabled); |
| 2687 | - } else if (isVirtualKeyBoardShow_ != VkState::VK_SHOW || lastKeyboardHeight_ != keyboard) { | ||
| 2688 | - return ProcessVirtualKeyBoardShow(width, height, keyboard, keyboardSafeAreaEnabled); | ||
| 2689 | } | 2688 | } |
| 2690 | - return !keyboardSafeAreaEnabled; | 2689 | + return ProcessVirtualKeyBoardShow(width, height, keyboard, keyboardSafeAreaEnabled); |
| 2691 | } | 2690 | } |
| 2692 | 2691 | ||
| 2693 | void WebPattern::UpdateWebLayoutSize(int32_t width, int32_t height, bool isKeyboard, bool isUpdate) | 2692 | void WebPattern::UpdateWebLayoutSize(int32_t width, int32_t height, bool isKeyboard, bool isUpdate) |