Skip to content

Commit 4f7d7c5

Browse files
committed
1.修改了AsyncStorage的导入
2.修改了iOS刷新回弹不自然的问题
1 parent d0deb8f commit 4f7d7c5

File tree

11 files changed

+69
-39
lines changed

11 files changed

+69
-39
lines changed

Examples/RefreshAndLoadingExample.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export class RefreshAndLoadingExample extends React.Component {
4545
onLoading={this._onLoading}
4646
// onScroll={()=>console.log("RefreshAndLoadingExample onScroll")}
4747
// allLoaded={this.state.allLoaded}
48-
refreshHeader={CommonLottieHeader}
49-
loadingFooter={CommonLottieFooter}>
48+
refreshHeader={ChineseWithLastDateHeader}
49+
loadingFooter={ChineseWithLastDateFooter}>
5050
<TouchableOpacity
5151
style={styles.text}
5252
onPress={() => this._scrollView.beginRefresh()}>

docs/zh-cn/_sidebar.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
* [Version 2 (Latest)](zh-cn/README)
1+
<!--
2+
* @Author: 石破天惊
3+
* @email: shanshang130@gmail.com
4+
* @Date: 2020-11-05 10:44:46
5+
* @LastEditTime: 2021-07-22 10:23:40
6+
* @LastEditors: 石破天惊
7+
* @Description:
8+
-->
9+
* [Version 3 (Latest)](zh-cn/README)
210
* [欢迎](zh-cn/README)
3-
* [快速接入](zh-cn/V2/GettingStart)
4-
* [简单使用](zh-cn/V2/Usage)
11+
* [快速接入](zh-cn/V3/GettingStart)
12+
* [简单使用](zh-cn/V3/Usage)
513
* SpringScrollView
6-
* [概述](zh-cn/V2/BasicContent)
7-
* [基本控制](zh-cn/V2/BasicControl)
8-
* [下拉刷新](zh-cn/V2/Refresh)
9-
* [自定义下拉刷新](zh-cn/V2/CustomRefresh)
10-
* [上拉加载](zh-cn/V2/Loading)
11-
* [自定义上拉加载](zh-cn/V2/CustomLoading)
12-
* [滑动 & 监听滑动](zh-cn/V2/Scroll)
13-
* [其他事件](zh-cn/V2/Event)
14-
* [处理键盘遮挡](zh-cn/V2/TextInput)
15-
* [已知问题](zh-cn/V2/KnownIssues)
14+
* [概述](zh-cn/V3/BasicContent)
15+
* [基本控制](zh-cn/V3/BasicControl)
16+
* [下拉刷新](zh-cn/V3/Refresh)
17+
* [自定义下拉刷新](zh-cn/V3/CustomRefresh)
18+
* [上拉加载](zh-cn/V3/Loading)
19+
* [自定义上拉加载](zh-cn/V3/CustomLoading)
20+
* [滑动 & 监听滑动](zh-cn/V3/Scroll)
21+
* [其他事件](zh-cn/V3/Event)
22+
* [处理键盘遮挡](zh-cn/V3/TextInput)
23+
* [已知问题](zh-cn/V3/KnownIssues)
1624
* [LargeList](https://bolan9999.github.io/react-native-largelist/#/)
1725
* 注意事项
1826

ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ target 'SSVExample' do
2121
#
2222
# Note that if you have use_frameworks! enabled, Flipper will not work and
2323
# you should disable the next line.
24-
use_flipper!()
24+
use_flipper!({'Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '1.3.1'})
2525

2626
post_install do |installer|
2727
react_native_post_install(installer)

ios/Podfile.lock

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ PODS:
336336
- React-cxxreact (= 0.64.2)
337337
- React-jsi (= 0.64.2)
338338
- React-perflogger (= 0.64.2)
339+
- RNCAsyncStorage (1.15.5):
340+
- React-Core
339341
- Yoga (1.14.0)
340342
- YogaKit (1.18.1):
341343
- Yoga (~> 1.14)
@@ -344,25 +346,25 @@ DEPENDENCIES:
344346
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
345347
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
346348
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
347-
- Flipper (~> 0.75.1)
349+
- Flipper (= 0.75.1)
348350
- Flipper-DoubleConversion (= 1.1.7)
349-
- Flipper-Folly (~> 2.5.3)
351+
- Flipper-Folly (= 2.5.3)
350352
- Flipper-Glog (= 0.3.6)
351353
- Flipper-PeerTalk (~> 0.0.4)
352-
- Flipper-RSocket (~> 1.3)
353-
- FlipperKit (~> 0.75.1)
354-
- FlipperKit/Core (~> 0.75.1)
355-
- FlipperKit/CppBridge (~> 0.75.1)
356-
- FlipperKit/FBCxxFollyDynamicConvert (~> 0.75.1)
357-
- FlipperKit/FBDefines (~> 0.75.1)
358-
- FlipperKit/FKPortForwarding (~> 0.75.1)
359-
- FlipperKit/FlipperKitHighlightOverlay (~> 0.75.1)
360-
- FlipperKit/FlipperKitLayoutPlugin (~> 0.75.1)
361-
- FlipperKit/FlipperKitLayoutTextSearchable (~> 0.75.1)
362-
- FlipperKit/FlipperKitNetworkPlugin (~> 0.75.1)
363-
- FlipperKit/FlipperKitReactPlugin (~> 0.75.1)
364-
- FlipperKit/FlipperKitUserDefaultsPlugin (~> 0.75.1)
365-
- FlipperKit/SKIOSNetworkPlugin (~> 0.75.1)
354+
- Flipper-RSocket (= 1.3.1)
355+
- FlipperKit (= 0.75.1)
356+
- FlipperKit/Core (= 0.75.1)
357+
- FlipperKit/CppBridge (= 0.75.1)
358+
- FlipperKit/FBCxxFollyDynamicConvert (= 0.75.1)
359+
- FlipperKit/FBDefines (= 0.75.1)
360+
- FlipperKit/FKPortForwarding (= 0.75.1)
361+
- FlipperKit/FlipperKitHighlightOverlay (= 0.75.1)
362+
- FlipperKit/FlipperKitLayoutPlugin (= 0.75.1)
363+
- FlipperKit/FlipperKitLayoutTextSearchable (= 0.75.1)
364+
- FlipperKit/FlipperKitNetworkPlugin (= 0.75.1)
365+
- FlipperKit/FlipperKitReactPlugin (= 0.75.1)
366+
- FlipperKit/FlipperKitUserDefaultsPlugin (= 0.75.1)
367+
- FlipperKit/SKIOSNetworkPlugin (= 0.75.1)
366368
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
367369
- hermes-engine (~> 0.7.2)
368370
- libevent (~> 2.1.12)
@@ -394,6 +396,7 @@ DEPENDENCIES:
394396
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
395397
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
396398
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
399+
- "RNCAsyncStorage (from `../node_modules/@react-native-async-storage/async-storage`)"
397400
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
398401

399402
SPEC REPOS:
@@ -471,6 +474,8 @@ EXTERNAL SOURCES:
471474
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
472475
ReactCommon:
473476
:path: "../node_modules/react-native/ReactCommon"
477+
RNCAsyncStorage:
478+
:path: "../node_modules/@react-native-async-storage/async-storage"
474479
Yoga:
475480
:path: "../node_modules/react-native/ReactCommon/yoga"
476481

@@ -516,9 +521,10 @@ SPEC CHECKSUMS:
516521
React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3
517522
React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9
518523
ReactCommon: 149906e01aa51142707a10665185db879898e966
524+
RNCAsyncStorage: 56a3355a10b5d660c48c6e37325ac85ebfd09885
519525
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
520526
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
521527

522-
PODFILE CHECKSUM: 447da2e27626338924b8bd96eef9f5189c84b5ec
528+
PODFILE CHECKSUM: 40bc489f0bc8dc46e82b34bda8328e7ba2641418
523529

524530
COCOAPODS: 1.10.1

ios/SSVExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@
536536
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537537
CLANG_ENABLE_MODULES = YES;
538538
CURRENT_PROJECT_VERSION = 1;
539+
DEVELOPMENT_TEAM = U38WZMUDZ2;
539540
ENABLE_BITCODE = NO;
540541
INFOPLIST_FILE = SSVExample/Info.plist;
541542
LD_RUNPATH_SEARCH_PATHS = (
@@ -563,6 +564,7 @@
563564
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
564565
CLANG_ENABLE_MODULES = YES;
565566
CURRENT_PROJECT_VERSION = 1;
567+
DEVELOPMENT_TEAM = U38WZMUDZ2;
566568
INFOPLIST_FILE = SSVExample/Info.plist;
567569
LD_RUNPATH_SEARCH_PATHS = (
568570
"$(inherited)",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13+
"@react-native-async-storage/async-storage": "^1.15.5",
1314
"lottie-ios": "3.1.8",
1415
"lottie-react-native": "^4.0.2",
1516
"react": "17.0.1",

src/Customize/WithLastDateFooter.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
*/
99

1010
import React from "react";
11-
import { Text, StyleSheet, AsyncStorage } from "react-native";
11+
import { Text, StyleSheet } from "react-native";
1212
import { HeaderStatus } from "../RefreshHeader";
1313
import {NormalFooter} from "../NormalFooter";
14+
import AsyncStorage from '@react-native-async-storage/async-storage';
1415

1516
const LoadingKey = "org.bolan9999.spring_scrollview.loading_time";
1617

src/Customize/WithLastDateHeader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
*/
99

1010
import React from "react";
11-
import { Text, StyleSheet, AsyncStorage } from "react-native";
11+
import { Text, StyleSheet } from "react-native";
1212
import { NormalHeader } from "../NormalHeader";
1313
import { HeaderStatus } from "../RefreshHeader";
14+
import AsyncStorage from '@react-native-async-storage/async-storage';
1415

1516
const RefreshKey = "org.bolan9999.spring_scrollview.refresh_time";
1617

src/Customize/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ export * from "./WithLastDateHeader";
1313
export * from "./ChineseWithLastDateHeader";
1414
export * from "./WithLastDateFooter";
1515
export * from "./ChineseWithLastDateFooter";
16+
export * from "./CommonLottieHeader";
17+
export * from "./CommonLottieFooter";

src/ios/SpringScrollView/STSpringScrollView.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
6969

7070
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{
7171
[super scrollViewDidEndDragging:scrollView willDecelerate:decelerate];
72-
self.dragging = NO;
7372
if ([self shouldLoad]) {
7473
self.loadingStatus = @"loading";
7574
CGFloat fill = .0f;
@@ -107,6 +106,12 @@ - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView
107106
targetContentOffset->y = round((self.scrollView.contentOffset.y - displacement)/[self getPageHeight])*[self getPageHeight];
108107
return;
109108
}
109+
self.dragging = NO;
110+
if([self shouldRefresh]){
111+
self.scrollView.contentInset = UIEdgeInsetsMake(self.refreshHeaderHeight, 0, 0, 0);
112+
targetContentOffset->y = -self.refreshHeaderHeight;
113+
self.refreshStatus = @"refreshing";
114+
}
110115
[super scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset];
111116
}
112117

src/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-spring-scrollview",
3-
"version": "3.0.1",
3+
"version": "3.0.1-rc.1",
44
"description": "A cross-platform (iOS & Android) spring ScrollView",
55
"main": "index.js",
66
"scripts": {
@@ -21,7 +21,11 @@
2121
"license": "MIT",
2222
"peerDependencies": {
2323
"react": "^16.3.1",
24-
"react-native": "^0.50.0",
25-
"lottie-react-native":"latest"
24+
"react-native": "^0.60.0"
25+
},
26+
"optionalDependencies":{
27+
"lottie-ios": "3.1.8",
28+
"lottie-react-native": "^4.0.2",
29+
"@react-native-community/async-storage": "^1.12.1"
2630
}
2731
}

0 commit comments

Comments
 (0)