feat(android): height issue fixed with keyboard avoiding component in new architecture (#45928)

Summary:
Fixes this issue: https://github.com/facebook/react-native/issues/45880

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [CHANGED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [CHANGED] - Replaced `mLastHeight` with `mVisibleViewArea.height()` since mLastHeight value is not getting updated. For `width` we are already using `mVisibleViewArea.width()`

Pull Request resolved: https://github.com/facebook/react-native/pull/45928

Test Plan: - Tested the fix in new and old architecture both

Reviewed By: christophpurrer

Differential Revision: D61023998

Pulled By: cortinico

fbshipit-source-id: df67616330effb7b9e6724d94b3be92c0dbd6190
This commit is contained in:
shubhamguptadream11
2024-08-19 17:51:23 +01:00
committed by Blake Friedman
parent 196399bb93
commit 1cea8e8027
@@ -891,7 +891,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
sendEvent(
"keyboardDidHide",
createKeyboardEventPayload(
PixelUtil.toDIPFromPixel(mLastHeight),
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
0,
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
0));
@@ -940,7 +940,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
sendEvent(
"keyboardDidHide",
createKeyboardEventPayload(
PixelUtil.toDIPFromPixel(mLastHeight),
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
0,
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
0));