mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 14:13:26 +00:00
Accept double args in ScrollView.scrollTo
Differential Revision: D2623473 fb-gh-sync-id: 8d4156e67f42d050f0f940d69ca534180d5a0b23
This commit is contained in:
parent
201318f949
commit
df36e388f1
@ -60,14 +60,14 @@ public class ReactScrollViewCommandHelper {
|
|||||||
Assertions.assertNotNull(args);
|
Assertions.assertNotNull(args);
|
||||||
switch (commandType) {
|
switch (commandType) {
|
||||||
case COMMAND_SCROLL_TO: {
|
case COMMAND_SCROLL_TO: {
|
||||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
|
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
|
||||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
|
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
|
||||||
viewManager.scrollTo(scrollView, new ScrollToCommandData(destX, destY));
|
viewManager.scrollTo(scrollView, new ScrollToCommandData(destX, destY));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case COMMAND_SCROLL_WITHOUT_ANIMATION_TO: {
|
case COMMAND_SCROLL_WITHOUT_ANIMATION_TO: {
|
||||||
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
|
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
|
||||||
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
|
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
|
||||||
viewManager.scrollWithoutAnimationTo(scrollView, new ScrollToCommandData(destX, destY));
|
viewManager.scrollWithoutAnimationTo(scrollView, new ScrollToCommandData(destX, destY));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user