Accept double args in ScrollView.scrollTo

Differential Revision: D2623473

fb-gh-sync-id: 8d4156e67f42d050f0f940d69ca534180d5a0b23
This commit is contained in:
Andy Street 2015-11-05 15:26:05 -08:00 committed by facebook-github-bot-4
parent 201318f949
commit df36e388f1
1 changed files with 4 additions and 4 deletions

View File

@ -60,14 +60,14 @@ public class ReactScrollViewCommandHelper {
Assertions.assertNotNull(args);
switch (commandType) {
case COMMAND_SCROLL_TO: {
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
viewManager.scrollTo(scrollView, new ScrollToCommandData(destX, destY));
return;
}
case COMMAND_SCROLL_WITHOUT_ANIMATION_TO: {
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getInt(0)));
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getInt(1)));
int destX = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(0)));
int destY = Math.round(PixelUtil.toPixelFromDIP(args.getDouble(1)));
viewManager.scrollWithoutAnimationTo(scrollView, new ScrollToCommandData(destX, destY));
return;
}