|
1 | 1 | import { EdgeCurrencyWallet, EdgeTokenId, EdgeTokenMap, EdgeTransaction } from 'edge-core-js'
|
2 | 2 | import { AssetStatus } from 'edge-info-server'
|
3 | 3 | import * as React from 'react'
|
4 |
| -import { ListRenderItemInfo, View } from 'react-native' |
| 4 | +import { ListRenderItemInfo, RefreshControl, View } from 'react-native' |
5 | 5 | import { getVersion } from 'react-native-device-info'
|
6 | 6 | import Animated from 'react-native-reanimated'
|
7 | 7 |
|
@@ -187,6 +187,23 @@ function TransactionListComponent(props: Props) {
|
187 | 187 | // Renderers
|
188 | 188 | //
|
189 | 189 |
|
| 190 | + /** |
| 191 | + * HACK: This `RefreshControl` doesn't actually do anything visually or |
| 192 | + * functionally noticeable besides making Android scroll gestures actually |
| 193 | + * work for the parent `Animated.FlatList` |
| 194 | + */ |
| 195 | + const refreshControl = React.useMemo(() => { |
| 196 | + return ( |
| 197 | + <RefreshControl |
| 198 | + refreshing={false} |
| 199 | + enabled={false} |
| 200 | + style={{ opacity: 0 }} |
| 201 | + // useHandler isn't needed, since we're already in useMemo: |
| 202 | + onRefresh={() => {}} |
| 203 | + /> |
| 204 | + ) |
| 205 | + }, []) |
| 206 | + |
190 | 207 | const topArea = React.useMemo(() => {
|
191 | 208 | return (
|
192 | 209 | <>
|
@@ -316,6 +333,9 @@ function TransactionListComponent(props: Props) {
|
316 | 333 | onEndReached={handleScrollEnd}
|
317 | 334 | onScroll={handleScroll}
|
318 | 335 | scrollIndicatorInsets={SCROLL_INDICATOR_INSET_FIX}
|
| 336 | + // Android scroll gestures break without refreshControl given the |
| 337 | + // combination of props we use on this Animated.FlatList. |
| 338 | + refreshControl={refreshControl} |
319 | 339 | />
|
320 | 340 | </View>
|
321 | 341 | )}
|
|
0 commit comments