Skip to content

Commit

Permalink
fix #4
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohuqiu committed Dec 19, 2014
1 parent dfd7113 commit 4303f55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<artifactId>grid-view-with-header-footer</artifactId>
<packaging>jar</packaging>
<name>GridViewWithHeaderAndFooter</name>
<version>1.0.8</version>
<version>1.0.9</version>

<description>GridView with Header and Footer</description>
<url>https://github.com/liaohuqiu/android-GridViewWithHeaderAndFooter</url>
Expand Down
9 changes: 7 additions & 2 deletions src/in/srain/cube/views/GridViewWithHeaderAndFooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package in.srain.cube.views;

import android.annotation.TargetApi;
import android.content.Context;
import android.database.DataSetObservable;
import android.database.DataSetObserver;
Expand Down Expand Up @@ -254,8 +255,9 @@ private void removeFixedViewInfo(View v, ArrayList<FixedViewInfo> where) {
}
}

@TargetApi(11)
private int getNumColumnsCompatible() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
if (Build.VERSION.SDK_INT >= 11) {
return super.getNumColumns();
} else {
try {
Expand All @@ -271,6 +273,7 @@ private int getNumColumnsCompatible() {
}
}

@TargetApi(16)
private int getColumnWidthCompatible() {
if (Build.VERSION.SDK_INT >= 16) {
return super.getColumnWidth();
Expand Down Expand Up @@ -325,6 +328,7 @@ public int getRowHeight() {
return mRowHeight;
}

@TargetApi(11)
public void tryToScrollToBottomSmoothly() {
int lastPos = getAdapter().getCount() - 1;
if (Build.VERSION.SDK_INT >= 11) {
Expand All @@ -334,6 +338,7 @@ public void tryToScrollToBottomSmoothly() {
}
}

@TargetApi(11)
public void tryToScrollToBottomSmoothly(int duration) {
int lastPos = getAdapter().getCount() - 1;
if (Build.VERSION.SDK_INT >= 11) {
Expand Down Expand Up @@ -369,7 +374,7 @@ public FullWidthFixedViewLayout(Context context) {

@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
int realLeft = getPaddingLeft();
int realLeft = GridViewWithHeaderAndFooter.this.getPaddingLeft() + getPaddingLeft();
// Try to make where it should be, from left, full width
if (realLeft != left) {
offsetLeftAndRight(realLeft - left);
Expand Down

0 comments on commit 4303f55

Please sign in to comment.