Skip to content

Commit 44c64c5

Browse files
author
Iain Connor
committed
Fixed size calculation
1 parent a7ed663 commit 44c64c5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

library/src/main/java/com/tippingcanoe/dewey/DeweyLayoutManager.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.support.v7.widget.LinearLayoutManager;
55
import android.support.v7.widget.RecyclerView;
66
import android.util.AttributeSet;
7+
import android.util.Log;
78
import android.view.View;
89
import android.view.ViewGroup;
910

@@ -98,8 +99,12 @@ public int getUniformCellWidth() {
9899
}
99100

100101
protected void updateUniformCellWidth() {
101-
if ( areCellsUniform() && (uniformCellWidth * getItemCount()) < getWidth() ) {
102-
forcedCellWidth = (int) ((float) getWidth() / (float) getItemCount());
102+
if ( areCellsUniform() ) {
103+
if ( (uniformCellWidth * getItemCount()) < getWidth() ) {
104+
forcedCellWidth = (int) ((float) getWidth() / (float) getItemCount());
105+
} else {
106+
forcedCellWidth = uniformCellWidth;
107+
}
103108
}
104109
}
105110

0 commit comments

Comments
 (0)