Fix missing setLeftTopRightBottom method (#44033)

Summary:
We were seeing errors due to `setLeftTopRightBottom` being called without a check for the Android version despite that method [being added in Android API level 29](https://developer.android.com/reference/android/view/View#setLeftTopRightBottom(int,%20int,%20int,%20int)). I've replaced it with the older API methods to fix the issue.

This issue originates from https://github.com/facebook/react-native/pull/38526

## Changelog:

[ANDROID] [FIXED] - Resolved error "No virtual method setLeftTopRightBottom"

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

Test Plan: Change is pretty trivial, but we tested it in our production app ([Tarteel](https://www.tarteel.ai/)) for a week and confirmed that the error is resolved.

Reviewed By: cortinico

Differential Revision: D56002098

Pulled By: NickGerleman

fbshipit-source-id: ff97d0be2703006b14c865dd148e40eb10069acb
This commit is contained in:
Mohamed Moussa
2024-04-11 04:28:07 -07:00
committed by Facebook GitHub Bot
parent 44d59ea6f9
commit 08ecdee71c
@@ -50,7 +50,10 @@ public class ReactHorizontalScrollContainerView extends ReactViewGroup {
int newLeft = 0;
int width = right - left;
int newRight = newLeft + width;
setLeftTopRightBottom(newLeft, top, newRight, bottom);
setLeft(newLeft);
setTop(top);
setRight(newRight);
setBottom(bottom);
}
}
}