@legendapp/list 2.0.0-next.1 → 2.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +8 -0
- package/.cursor/rules/changelog.mdc +60 -0
- package/.github/FUNDING.yml +15 -0
- package/.gitignore +5 -0
- package/.prettierrc.json +5 -0
- package/.vscode/settings.json +14 -0
- package/CLAUDE.md +126 -0
- package/biome.json +46 -0
- package/bun.lock +1289 -0
- package/bunfig.toml +2 -0
- package/dist/CHANGELOG.md +119 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +139 -0
- package/{animated.d.mts → dist/animated.d.mts} +1 -1
- package/{animated.d.ts → dist/animated.d.ts} +1 -1
- package/{index.d.mts → dist/index.d.mts} +16 -10
- package/{index.d.ts → dist/index.d.ts} +16 -10
- package/{index.js → dist/index.js} +52 -32
- package/{index.mjs → dist/index.mjs} +52 -32
- package/{keyboard-controller.d.mts → dist/keyboard-controller.d.mts} +4 -4
- package/{keyboard-controller.d.ts → dist/keyboard-controller.d.ts} +4 -4
- package/dist/package.json +35 -0
- package/example/README.md +40 -0
- package/example/api/data/genres.json +23 -0
- package/example/api/data/playlist/10402-10749.json +1 -0
- package/example/api/data/playlist/10402-10770.json +1 -0
- package/example/api/data/playlist/10402-37.json +1 -0
- package/example/api/data/playlist/10749-10752.json +1 -0
- package/example/api/data/playlist/10749-10770.json +1 -0
- package/example/api/data/playlist/10749-37.json +1 -0
- package/example/api/data/playlist/10749-878.json +1 -0
- package/example/api/data/playlist/10751-10402.json +1 -0
- package/example/api/data/playlist/10751-10752.json +1 -0
- package/example/api/data/playlist/10751-37.json +1 -0
- package/example/api/data/playlist/10751-53.json +1 -0
- package/example/api/data/playlist/10751-878.json +1 -0
- package/example/api/data/playlist/10751-9648.json +1 -0
- package/example/api/data/playlist/10752-37.json +1 -0
- package/example/api/data/playlist/12-10402.json +1 -0
- package/example/api/data/playlist/12-10749.json +1 -0
- package/example/api/data/playlist/12-18.json +1 -0
- package/example/api/data/playlist/12-27.json +1 -0
- package/example/api/data/playlist/12-35.json +1 -0
- package/example/api/data/playlist/14-36.json +1 -0
- package/example/api/data/playlist/14-878.json +1 -0
- package/example/api/data/playlist/16-10751.json +1 -0
- package/example/api/data/playlist/16-10770.json +1 -0
- package/example/api/data/playlist/16-35.json +1 -0
- package/example/api/data/playlist/16-36.json +1 -0
- package/example/api/data/playlist/16-53.json +1 -0
- package/example/api/data/playlist/18-10751.json +1 -0
- package/example/api/data/playlist/18-10752.json +1 -0
- package/example/api/data/playlist/18-37.json +1 -0
- package/example/api/data/playlist/18-53.json +1 -0
- package/example/api/data/playlist/18-878.json +1 -0
- package/example/api/data/playlist/27-10749.json +1 -0
- package/example/api/data/playlist/27-10770.json +1 -0
- package/example/api/data/playlist/28-10749.json +1 -0
- package/example/api/data/playlist/28-10751.json +1 -0
- package/example/api/data/playlist/28-10770.json +1 -0
- package/example/api/data/playlist/28-16.json +1 -0
- package/example/api/data/playlist/28-18.json +1 -0
- package/example/api/data/playlist/28-36.json +1 -0
- package/example/api/data/playlist/28-37.json +1 -0
- package/example/api/data/playlist/28-53.json +1 -0
- package/example/api/data/playlist/28-80.json +1 -0
- package/example/api/data/playlist/28-99.json +1 -0
- package/example/api/data/playlist/35-10749.json +1 -0
- package/example/api/data/playlist/35-10751.json +1 -0
- package/example/api/data/playlist/35-10752.json +1 -0
- package/example/api/data/playlist/35-27.json +1 -0
- package/example/api/data/playlist/35-36.json +1 -0
- package/example/api/data/playlist/35-53.json +1 -0
- package/example/api/data/playlist/35-80.json +1 -0
- package/example/api/data/playlist/36-37.json +1 -0
- package/example/api/data/playlist/36-878.json +1 -0
- package/example/api/data/playlist/36-9648.json +1 -0
- package/example/api/data/playlist/53-10752.json +1 -0
- package/example/api/data/playlist/80-10770.json +1 -0
- package/example/api/data/playlist/80-14.json +1 -0
- package/example/api/data/playlist/80-18.json +1 -0
- package/example/api/data/playlist/80-37.json +1 -0
- package/example/api/data/playlist/878-37.json +1 -0
- package/example/api/data/playlist/9648-10770.json +1 -0
- package/example/api/data/playlist/9648-37.json +1 -0
- package/example/api/data/playlist/9648-53.json +1 -0
- package/example/api/data/playlist/9648-878.json +1 -0
- package/example/api/data/playlist/99-10749.json +1 -0
- package/example/api/data/playlist/99-14.json +1 -0
- package/example/api/data/playlist/99-18.json +1 -0
- package/example/api/data/playlist/99-27.json +1 -0
- package/example/api/data/playlist/99-53.json +1 -0
- package/example/api/data/playlist/99-9648.json +1 -0
- package/example/api/data/playlist/index.ts +73 -0
- package/example/api/data/rows.json +1 -0
- package/example/api/index.ts +36 -0
- package/example/app/(tabs)/_layout.tsx +60 -0
- package/example/app/(tabs)/cards.tsx +81 -0
- package/example/app/(tabs)/index.tsx +205 -0
- package/example/app/(tabs)/moviesL.tsx +7 -0
- package/example/app/(tabs)/moviesLR.tsx +7 -0
- package/example/app/+not-found.tsx +32 -0
- package/example/app/_layout.tsx +34 -0
- package/example/app/accurate-scrollto/index.tsx +125 -0
- package/example/app/accurate-scrollto-2/index.tsx +52 -0
- package/example/app/accurate-scrollto-huge/index.tsx +128 -0
- package/example/app/add-to-end/index.tsx +82 -0
- package/example/app/ai-chat/index.tsx +236 -0
- package/example/app/bidirectional-infinite-list/index.tsx +133 -0
- package/example/app/cards-columns/index.tsx +37 -0
- package/example/app/cards-flashlist/index.tsx +122 -0
- package/example/app/cards-flatlist/index.tsx +94 -0
- package/example/app/cards-no-recycle/index.tsx +110 -0
- package/example/app/cards-renderItem.tsx +354 -0
- package/example/app/chat-example/index.tsx +167 -0
- package/example/app/chat-infinite/index.tsx +239 -0
- package/example/app/chat-keyboard/index.tsx +248 -0
- package/example/app/chat-resize-outer/index.tsx +247 -0
- package/example/app/columns/index.tsx +78 -0
- package/example/app/countries/index.tsx +182 -0
- package/example/app/countries-flashlist/index.tsx +163 -0
- package/example/app/countries-reorder/index.tsx +187 -0
- package/example/app/extra-data/index.tsx +86 -0
- package/example/app/filter-elements/filter-data-provider.tsx +55 -0
- package/example/app/filter-elements/index.tsx +118 -0
- package/example/app/initial-scroll-index/index.tsx +106 -0
- package/example/app/initial-scroll-index/renderFixedItem.tsx +215 -0
- package/example/app/initial-scroll-index-free-height/index.tsx +70 -0
- package/example/app/initial-scroll-index-keyed/index.tsx +62 -0
- package/example/app/lazy-list/index.tsx +123 -0
- package/example/app/movies-flashlist/index.tsx +7 -0
- package/example/app/mutable-cells/index.tsx +104 -0
- package/example/app/video-feed/index.tsx +119 -0
- package/example/app.config.js +22 -0
- package/example/app.json +45 -0
- package/example/assets/fonts/SpaceMono-Regular.ttf +0 -0
- package/example/assets/images/adaptive-icon.png +0 -0
- package/example/assets/images/favicon.png +0 -0
- package/example/assets/images/icon.png +0 -0
- package/example/assets/images/partial-react-logo.png +0 -0
- package/example/assets/images/react-logo.png +0 -0
- package/example/assets/images/react-logo@2x.png +0 -0
- package/example/assets/images/react-logo@3x.png +0 -0
- package/example/assets/images/splash-icon.png +0 -0
- package/example/autoscroll.sh +101 -0
- package/example/bun.lock +2266 -0
- package/example/bunfig.toml +2 -0
- package/example/components/Breathe.tsx +54 -0
- package/example/components/Circle.tsx +69 -0
- package/example/components/Collapsible.tsx +44 -0
- package/example/components/ExternalLink.tsx +24 -0
- package/example/components/HapticTab.tsx +18 -0
- package/example/components/HelloWave.tsx +37 -0
- package/example/components/Movies.tsx +179 -0
- package/example/components/ParallaxScrollView.tsx +81 -0
- package/example/components/ThemedText.tsx +60 -0
- package/example/components/ThemedView.tsx +14 -0
- package/example/components/__tests__/ThemedText-test.tsx +10 -0
- package/example/components/__tests__/__snapshots__/ThemedText-test.tsx.snap +24 -0
- package/example/components/ui/IconSymbol.ios.tsx +32 -0
- package/example/components/ui/IconSymbol.tsx +43 -0
- package/example/components/ui/TabBarBackground.ios.tsx +22 -0
- package/example/components/ui/TabBarBackground.tsx +6 -0
- package/example/constants/Colors.ts +26 -0
- package/example/constants/constants.ts +5 -0
- package/example/constants/useScrollTest.ts +19 -0
- package/example/hooks/useColorScheme.ts +1 -0
- package/example/hooks/useColorScheme.web.ts +8 -0
- package/example/hooks/useThemeColor.ts +22 -0
- package/example/ios/.xcode.env +11 -0
- package/example/ios/Podfile +64 -0
- package/example/ios/Podfile.lock +2767 -0
- package/example/ios/Podfile.properties.json +5 -0
- package/example/ios/listtest/AppDelegate.swift +70 -0
- package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/App-Icon-1024x1024@1x.png +0 -0
- package/example/ios/listtest/Images.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/example/ios/listtest/Images.xcassets/Contents.json +6 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenBackground.colorset/Contents.json +20 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/Contents.json +23 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image.png +0 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@2x.png +0 -0
- package/example/ios/listtest/Images.xcassets/SplashScreenLogo.imageset/image@3x.png +0 -0
- package/example/ios/listtest/Info.plist +85 -0
- package/example/ios/listtest/PrivacyInfo.xcprivacy +48 -0
- package/example/ios/listtest/SplashScreen.storyboard +42 -0
- package/example/ios/listtest/Supporting/Expo.plist +12 -0
- package/example/ios/listtest/listtest-Bridging-Header.h +3 -0
- package/example/ios/listtest/listtest.entitlements +5 -0
- package/example/ios/listtest.xcodeproj/project.pbxproj +547 -0
- package/example/ios/listtest.xcodeproj/xcshareddata/xcschemes/listtest.xcscheme +88 -0
- package/example/ios/listtest.xcworkspace/contents.xcworkspacedata +10 -0
- package/example/metro.config.js +16 -0
- package/example/package.json +73 -0
- package/example/scripts/reset-project.js +84 -0
- package/example/tsconfig.json +26 -0
- package/package.json +88 -34
- package/posttsup.ts +24 -0
- package/src/Container.tsx +176 -0
- package/src/Containers.tsx +85 -0
- package/src/ContextContainer.ts +145 -0
- package/src/DebugView.tsx +83 -0
- package/src/LazyLegendList.tsx +41 -0
- package/src/LeanView.tsx +18 -0
- package/src/LegendList.tsx +558 -0
- package/src/ListComponent.tsx +191 -0
- package/src/ScrollAdjust.tsx +24 -0
- package/src/ScrollAdjustHandler.ts +26 -0
- package/src/Separator.tsx +14 -0
- package/src/animated.tsx +6 -0
- package/src/calculateItemsInView.ts +363 -0
- package/src/calculateOffsetForIndex.ts +23 -0
- package/src/calculateOffsetWithOffsetPosition.ts +26 -0
- package/src/checkAllSizesKnown.ts +17 -0
- package/src/checkAtBottom.ts +36 -0
- package/src/checkAtTop.ts +27 -0
- package/src/checkThreshold.ts +30 -0
- package/src/constants.ts +11 -0
- package/src/createColumnWrapperStyle.ts +16 -0
- package/src/doInitialAllocateContainers.ts +40 -0
- package/src/doMaintainScrollAtEnd.ts +34 -0
- package/src/findAvailableContainers.ts +98 -0
- package/src/finishScrollTo.ts +8 -0
- package/src/getId.ts +21 -0
- package/src/getItemSize.ts +52 -0
- package/src/getRenderedItem.ts +34 -0
- package/src/getScrollVelocity.ts +47 -0
- package/src/handleLayout.ts +70 -0
- package/src/helpers.ts +39 -0
- package/src/index.ts +11 -0
- package/src/keyboard-controller.tsx +63 -0
- package/src/onScroll.ts +66 -0
- package/src/prepareMVCP.ts +50 -0
- package/src/reanimated.tsx +63 -0
- package/src/requestAdjust.ts +41 -0
- package/src/scrollTo.ts +40 -0
- package/src/scrollToIndex.ts +34 -0
- package/src/setDidLayout.ts +25 -0
- package/src/setPaddingTop.ts +28 -0
- package/src/state.tsx +304 -0
- package/src/types.ts +610 -0
- package/src/updateAlignItemsPaddingTop.ts +18 -0
- package/src/updateAllPositions.ts +130 -0
- package/src/updateItemSize.ts +203 -0
- package/src/updateTotalSize.ts +44 -0
- package/src/useAnimatedValue.ts +6 -0
- package/src/useCombinedRef.ts +22 -0
- package/src/useInit.ts +17 -0
- package/src/useSyncLayout.tsx +68 -0
- package/src/useValue$.ts +53 -0
- package/src/viewability.ts +279 -0
- package/tsconfig.json +59 -0
- package/tsup.config.ts +21 -0
- /package/{animated.js → dist/animated.js} +0 -0
- /package/{animated.mjs → dist/animated.mjs} +0 -0
- /package/{keyboard-controller.js → dist/keyboard-controller.js} +0 -0
- /package/{keyboard-controller.mjs → dist/keyboard-controller.mjs} +0 -0
- /package/{reanimated.d.mts → dist/reanimated.d.mts} +0 -0
- /package/{reanimated.d.ts → dist/reanimated.d.ts} +0 -0
- /package/{reanimated.js → dist/reanimated.js} +0 -0
- /package/{reanimated.mjs → dist/reanimated.mjs} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const OLD_ARCH = process.env.OLD_ARCH === 'TRUE';
|
|
2
|
+
const RELEASE = process.env.RELEASE === 'TRUE';
|
|
3
|
+
|
|
4
|
+
export default ({ config }) => {
|
|
5
|
+
const bundleIdentifier = `com.legendapp.listtest${OLD_ARCH ? '.o' : ''}${OLD_ARCH ? '.r' : ''}`;
|
|
6
|
+
return {
|
|
7
|
+
...config,
|
|
8
|
+
newArchEnabled: !OLD_ARCH,
|
|
9
|
+
ios: {
|
|
10
|
+
supportsTablet: true,
|
|
11
|
+
bundleIdentifier,
|
|
12
|
+
},
|
|
13
|
+
android: {
|
|
14
|
+
adaptiveIcon: {
|
|
15
|
+
foregroundImage: './assets/images/adaptive-icon.png',
|
|
16
|
+
backgroundColor: '#ffffff',
|
|
17
|
+
},
|
|
18
|
+
package: bundleIdentifier,
|
|
19
|
+
},
|
|
20
|
+
name: `list-test${OLD_ARCH ? '-o' : ''}${RELEASE ? '-r' : ''}`,
|
|
21
|
+
};
|
|
22
|
+
};
|
package/example/app.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expo": {
|
|
3
|
+
"name": "list-test",
|
|
4
|
+
"slug": "list-test",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"orientation": "portrait",
|
|
7
|
+
"icon": "./assets/images/icon.png",
|
|
8
|
+
"scheme": "myapp",
|
|
9
|
+
"userInterfaceStyle": "automatic",
|
|
10
|
+
"newArchEnabled": true,
|
|
11
|
+
"ios": {
|
|
12
|
+
"supportsTablet": true,
|
|
13
|
+
"bundleIdentifier": "com.legendapp.listtest"
|
|
14
|
+
},
|
|
15
|
+
"android": {
|
|
16
|
+
"adaptiveIcon": {
|
|
17
|
+
"foregroundImage": "./assets/images/adaptive-icon.png",
|
|
18
|
+
"backgroundColor": "#ffffff"
|
|
19
|
+
},
|
|
20
|
+
"package": "com.legendapp.listtest"
|
|
21
|
+
},
|
|
22
|
+
"web": {
|
|
23
|
+
"bundler": "metro",
|
|
24
|
+
"output": "static",
|
|
25
|
+
"favicon": "./assets/images/favicon.png"
|
|
26
|
+
},
|
|
27
|
+
"plugins": [
|
|
28
|
+
"expo-router",
|
|
29
|
+
[
|
|
30
|
+
"expo-splash-screen",
|
|
31
|
+
{
|
|
32
|
+
"image": "./assets/images/splash-icon.png",
|
|
33
|
+
"imageWidth": 200,
|
|
34
|
+
"resizeMode": "contain",
|
|
35
|
+
"backgroundColor": "#ffffff"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"expo-font"
|
|
39
|
+
],
|
|
40
|
+
"experiments": {
|
|
41
|
+
"typedRoutes": true,
|
|
42
|
+
"reactCompiler": false
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Thank you to @ @naqvitalha for this script!
|
|
4
|
+
# https://gist.github.com/naqvitalha/8ac4404a65bd314906447541f2e6baf1
|
|
5
|
+
#
|
|
6
|
+
# Continuous ADB Scroll Down Script with Speed Control
|
|
7
|
+
# Continuously swipes down a fixed distance until manually stopped (Ctrl+C).
|
|
8
|
+
# An optional speed multiplier can be provided as an argument.
|
|
9
|
+
# Usage: ./adb_scroll.sh [SPEED_MULTIPLIER] [DURATION_MS]
|
|
10
|
+
#
|
|
11
|
+
# Arguments:
|
|
12
|
+
# SPEED_MULTIPLIER: Optional. Multiplier for swipe speed. Higher is faster (shorter duration). Default: 1
|
|
13
|
+
# DURATION_MS: Optional. Duration to run the script in milliseconds. Default: -1 (run forever)
|
|
14
|
+
#
|
|
15
|
+
# Example:
|
|
16
|
+
# ./adb_scroll.sh # Run with default speed (1x) forever
|
|
17
|
+
# ./adb_scroll.sh 3 # Run 3x faster forever
|
|
18
|
+
# ./adb_scroll.sh 2 5000 # Run 2x faster for 5000ms (5 seconds)
|
|
19
|
+
# ./adb_scroll.sh "" 3000 # Run default speed for 3000ms (3 seconds)
|
|
20
|
+
|
|
21
|
+
# --- Configuration ---
|
|
22
|
+
START_Y=1500 # Starting Y coordinate for the swipe (near bottom)
|
|
23
|
+
X=2 # X coordinate for the swipe (center)
|
|
24
|
+
SWIPE_DISTANCE=700 # Fixed distance for each swipe (pixels)
|
|
25
|
+
BASE_SWIPE_DURATION=48 # Base duration for each swipe (milliseconds) - will be divided by multiplier
|
|
26
|
+
DEFAULT_SPEED_MULTIPLIER=1 # Default speed multiplier if none provided
|
|
27
|
+
SLEEP_BETWEEN=100 # Sleep time between swipes (milliseconds)
|
|
28
|
+
DEFAULT_DURATION=-1 # Default duration in milliseconds (-1 means run forever)
|
|
29
|
+
|
|
30
|
+
# --- Argument Parsing ---
|
|
31
|
+
SPEED_MULTIPLIER=${1:-$DEFAULT_SPEED_MULTIPLIER}
|
|
32
|
+
DURATION=${2:-$DEFAULT_DURATION}
|
|
33
|
+
|
|
34
|
+
# --- Input Validation ---
|
|
35
|
+
if ! [[ "$SPEED_MULTIPLIER" =~ ^[0-9]*\.?[0-9]+$ ]] || (( $(echo "$SPEED_MULTIPLIER <= 0" | bc -l) )); then
|
|
36
|
+
echo "Error: SPEED_MULTIPLIER must be a positive number."
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if ! [[ "$DURATION" =~ ^-?[0-9]+$ ]]; then
|
|
41
|
+
echo "Error: DURATION must be an integer (use -1 for infinite)."
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
# --- Calculations ---
|
|
46
|
+
# Calculate actual swipe duration
|
|
47
|
+
SWIPE_DURATION=$(echo "scale=0; $BASE_SWIPE_DURATION / $SPEED_MULTIPLIER" | bc)
|
|
48
|
+
|
|
49
|
+
# Ensure duration is at least 1ms
|
|
50
|
+
if [ -z "$SWIPE_DURATION" ] || [ "$SWIPE_DURATION" -lt 1 ]; then
|
|
51
|
+
SWIPE_DURATION=1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
END_Y=$(( START_Y - SWIPE_DISTANCE ))
|
|
55
|
+
|
|
56
|
+
# Clamp END_Y to 0 if it goes below zero
|
|
57
|
+
if [ "$END_Y" -lt 0 ]; then
|
|
58
|
+
END_Y=0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo "Starting continuous ADB scroll down..."
|
|
62
|
+
echo "Press Ctrl+C to stop."
|
|
63
|
+
echo "-------------------------------"
|
|
64
|
+
echo "Device: $(adb devices | grep -v List | cut -f1)"
|
|
65
|
+
echo "Speed Multiplier: ${SPEED_MULTIPLIER}x"
|
|
66
|
+
echo "Base Swipe Duration: ${BASE_SWIPE_DURATION}ms"
|
|
67
|
+
echo "Effective Swipe Duration: ${SWIPE_DURATION}ms"
|
|
68
|
+
echo "Swipe: X=$X, Y: $START_Y -> $END_Y"
|
|
69
|
+
echo "Sleep Between: ${SLEEP_BETWEEN}ms"
|
|
70
|
+
if [ "$DURATION" -ne -1 ]; then
|
|
71
|
+
echo "Duration: ${DURATION}ms"
|
|
72
|
+
fi
|
|
73
|
+
echo "-------------------------------"
|
|
74
|
+
|
|
75
|
+
# Calculate start time for duration tracking
|
|
76
|
+
START_TIME=$(date +%s) # Current time in seconds
|
|
77
|
+
|
|
78
|
+
while true; do
|
|
79
|
+
# Execute the swipe command
|
|
80
|
+
adb shell input swipe $X $START_Y $X $END_Y $SWIPE_DURATION
|
|
81
|
+
|
|
82
|
+
# Brief pause
|
|
83
|
+
sleep $(echo "scale=6; $SLEEP_BETWEEN / 1000" | bc)
|
|
84
|
+
|
|
85
|
+
# Check if we've reached the duration limit (if set)
|
|
86
|
+
if [ "$DURATION" -ne -1 ]; then
|
|
87
|
+
CURRENT_TIME=$(date +%s)
|
|
88
|
+
ELAPSED_TIME_SEC=$(( CURRENT_TIME - START_TIME ))
|
|
89
|
+
ELAPSED_TIME_MS=$(( ELAPSED_TIME_SEC * 1000 ))
|
|
90
|
+
|
|
91
|
+
if [ "$ELAPSED_TIME_MS" -ge "$DURATION" ]; then
|
|
92
|
+
echo "Duration limit of ${DURATION}ms reached. Stopping."
|
|
93
|
+
break
|
|
94
|
+
fi
|
|
95
|
+
fi
|
|
96
|
+
done
|
|
97
|
+
|
|
98
|
+
# This part is reached when duration is complete or if the loop is broken
|
|
99
|
+
echo "-------------------------------"
|
|
100
|
+
echo "ADB scroll stopped."
|
|
101
|
+
exit 0
|