forked from wonday/react-native-pdf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PdfViewFlatList.js
32 lines (29 loc) · 967 Bytes
/
PdfViewFlatList.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* Copyright (c) 2017-present, Wonday (@wonday.org)
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict';
import React, {Component} from 'react';
import {
FlatList,
} from 'react-native';
export default class PdfViewFlatList extends FlatList {
/**
* Scrolls to a given x, y offset, either immediately or with a smooth animation.
*
* Example:
*
* `scrollTo({x: 0, y: 0, animated: true})`
*
* Note: The weird function signature is due to the fact that, for historical reasons,
* the function also accepts separate arguments as an alternative to the options object.
* This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED.
*/
scrollToXY = (x, y) => {
this._listRef._scrollRef.scrollTo({x: x, y: y, animated: false});
console.log(x, y);
}
}