Skip to content

Commit

Permalink
Merge pull request #59 from bolan9999/develop
Browse files Browse the repository at this point in the history
Bug Fix:
  • Loading branch information
石破天惊 authored Jan 14, 2018
2 parents a544edf + 3e064ef commit f62158b
Show file tree
Hide file tree
Showing 10 changed files with 1,403 additions and 1,394 deletions.
4 changes: 2 additions & 2 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export default class App extends React.Component {
/>
);
case 3:
return <LargeListSample2 style={{ flex: 1 }} />;
return <LargeListSample2 style={{ flex: 1, marginTop:40 }} />;
case 4:
return <LargeListSample3 style={{ flex: 1 }} />;
return <LargeListSample3 style={{ flex: 1, marginTop:40 }} />;
case 5:
return <LargeListSample4/>
}
Expand Down
3 changes: 3 additions & 0 deletions README-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ onScroll | ({nativeEvent:{contentOffset:{x:number,y:number}}})=> any | | 滑动

## 更新日志

### 版本 1.2.4
* 修复初始化时是空视图,numberOfCellPoolSize默认值过小的问题

### 版本 1.2.3
* 修复TypeScript类型声明错误

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ Get LargeList's footer height

## Update Log

### Version 1.2.4
* Fix default numberOfCellPoolSize error when empty.

### Version 1.2.3
* Fix typescript type define.

Expand Down
4 changes: 2 additions & 2 deletions ios/LargeListDemo/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
{
NSURL *jsCodeLocation;
#ifdef DEBUG
jsCodeLocation = [NSURL URLWithString:@"http://10.16.64.93:8081/index.bundle?platform=ios&dev=true"];
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.103:8081/index.bundle?platform=ios&dev=true"];
// jsCodeLocation = [NSURL URLWithString:@"http://10.16.64.93:8081/index.bundle?platform=ios&dev=true"];
jsCodeLocation = [NSURL URLWithString:@"http://192.168.1.103:8081/index.bundle?platform=ios&dev=true"];
// jsCodeLocation = [NSURL URLWithString:@"http://172.20.10.4:8081/index.bundle?platform=ios&dev=true"];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
Expand Down
13 changes: 8 additions & 5 deletions react-native-largelist/largelist/LargeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ class LargeList extends React.Component {
this.contentSize = { width: 0, height: 0 };
this.lastScrollTime = 0;
this.currentSection = 0;
this.minCellHeight = 100;
this.minSectionHeight = 100;
this.minCellHeight = 40;
this.minSectionHeight = 40;
this.sizeConfirmed = false;
this.headerHeight = null;
this.footerHeight = null;
Expand Down Expand Up @@ -513,7 +513,8 @@ class LargeList extends React.Component {
});
this.workRefs.forEach(item => {
if (this._compareIndexPath(item.indexPath, this.topIndexPath) < 0) {
this.freeRefs.splice(0, 0, item);
// this.freeRefs.splice(0, 0, item);
this.freeRefs.push(item);
}
});
this.freeRefs.forEach(cell => {
Expand Down Expand Up @@ -627,7 +628,8 @@ class LargeList extends React.Component {

this.workRefs.forEach(item => {
if (this._compareIndexPath(item.indexPath, this.bottomIndexPath) > 0) {
this.freeRefs.splice(0, 0, item);
// this.freeRefs.splice(0, 0, item);
this.freeRefs.push(item);
}
});
this.freeRefs.forEach(cell => {
Expand Down Expand Up @@ -1017,7 +1019,8 @@ class LargeList extends React.Component {
this.initVar();
this.safeArea = { top: 0, bottom: 0 };
this.workRefs.forEach(cell => {
this.freeRefs.splice(0, 0, cell);
// this.freeRefs.splice(0, 0, cell);
this.freeRefs.push(cell);
});
this.freeRefs.forEach(cell => {
cell.waitForRender = true;
Expand Down
3 changes: 2 additions & 1 deletion react-native-largelist/largelist/LargeListCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class LargeListCell extends React.Component {
render() {
let { section, row } = this.indexPath;
let show =
this.top !== -10000 &&
// this.top !== -10000 &&
section >= 0 &&
section < this.props.numberOfSections() &&
row >= 0 &&
Expand All @@ -140,6 +140,7 @@ class LargeListCell extends React.Component {
>
{show &&
this.props.renderCell(this.indexPath.section, this.indexPath.row)}
{show && this._renderItemSeparator()}
</View>
);
let contentStyle = this.contentSize.width
Expand Down
Loading

0 comments on commit f62158b

Please sign in to comment.