Skip to content
This repository was archived by the owner on Mar 27, 2022. It is now read-only.

Commit 8b863f6

Browse files
committed
fixed empty gridview issue
1 parent 7f2885e commit 8b863f6

4 files changed

Lines changed: 4 additions & 13 deletions

File tree

.idea/modules.xml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ and:
2424

2525
```gradle
2626
dependencies {
27-
compile 'com.github.ceryle:fitgridview:v1.0.2'
27+
compile 'com.github.ceryle:fitgridview:v1.0.3'
2828
}
2929
```
3030

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.3.0'
8+
classpath 'com.android.tools.build:gradle:2.3.1'
99
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1010

1111
// NOTE: Do not place your application dependencies here; they belong

library/src/main/java/co/ceryle/fitgridview/FitGridView.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,8 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
9292
}
9393

9494
private void remeasure() {
95-
if (column == 0 || row == 0)
96-
return;
97-
98-
itemWidth = getMeasuredWidth() / column;
99-
itemHeight = getMeasuredHeight() / row;
95+
itemWidth = getMeasuredWidth() / (column == 0 ? 1 : column);
96+
itemHeight = getMeasuredHeight() / (row == 0 ? 1 : row);
10097
}
10198

10299
/**

0 commit comments

Comments
 (0)