Skip to content

Commit

Permalink
修改只有一页图片滚动时出现异常
Browse files Browse the repository at this point in the history
  • Loading branch information
dodola committed Apr 19, 2012
1 parent b9875a6 commit fa56c47
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/com/dodowaterfall/MainActivity.java
Expand Up @@ -161,22 +161,24 @@ public void onAutoScroll(int l, int t, int oldl, int oldt) {

}
} else {// 向上滚动
if (t > 2 * scroll_height) {// 超过两屏幕后
for (int k = 0; k < column_count; k++) {
LinearLayout localLinearLayout = waterfall_items
.get(k);
if (pin_mark[k].get(bottomIndex[k]) > t + 3
* scroll_height) {
((FlowView) localLinearLayout
.getChildAt(bottomIndex[k])).recycle();

for (int k = 0; k < column_count; k++) {
LinearLayout localLinearLayout = waterfall_items.get(k);
if (pin_mark[k].get(bottomIndex[k]) > t + 3
* scroll_height) {
((FlowView) localLinearLayout
.getChildAt(bottomIndex[k])).recycle();

bottomIndex[k]--;
}
bottomIndex[k]--;
}

if (pin_mark[k].get(Math.max(topIndex[k] - 1, 0)) >= t
- 2 * scroll_height) {
((FlowView) localLinearLayout.getChildAt(Math.max(
-1 + topIndex[k], 0))).Reload();
topIndex[k] = Math.max(topIndex[k] - 1, 0);
if (pin_mark[k].get(Math.max(topIndex[k] - 1, 0)) >= t
- 2 * scroll_height) {
((FlowView) localLinearLayout.getChildAt(Math
.max(-1 + topIndex[k], 0))).Reload();
topIndex[k] = Math.max(topIndex[k] - 1, 0);
}
}
}

Expand Down

0 comments on commit fa56c47

Please sign in to comment.