Skip to content

Commit

Permalink
Fix width estimate in WheelView.java
Browse files Browse the repository at this point in the history
WheelView method buildViewForMeasuring() used only first three items to estimate
required width. This is often wrong, as can be seen in the second wheel on the
Time 2 Demo (the next ten entries after 9 are all 1, followed by four 2s).
  • Loading branch information
birgerro committed Mar 14, 2015
1 parent 439cbad commit 13b0b8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wheel/src/kankan/wheel/widget/WheelView.java
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@ private void buildViewForMeasuring() {
}

// add views
int addItems = visibleItems / 2;
for (int i = currentItem + addItems; i >= currentItem - addItems; i--) {
// all items must be included to measure width correctly
for (int i = viewAdapter.getItemsCount()-1; i >= 0; i--){
if (addViewItem(i, true)) {
firstItem = i;
}
Expand Down

0 comments on commit 13b0b8d

Please sign in to comment.