Skip to content

Commit

Permalink
fix #11, thanks @pushbit, Get original ListAdapter for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
liaohuqiu committed May 16, 2015
1 parent c1e7ff1 commit 8cca8b4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/in/srain/cube/views/GridViewWithHeaderAndFooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private static class FixedViewInfo {

private ArrayList<FixedViewInfo> mHeaderViewInfos = new ArrayList<FixedViewInfo>();
private ArrayList<FixedViewInfo> mFooterViewInfos = new ArrayList<FixedViewInfo>();
private ListAdapter mOriginalAdapter;

private void initHeaderGridView() {
}
Expand Down Expand Up @@ -400,6 +401,7 @@ public void tryToScrollToBottomSmoothly(int duration) {

@Override
public void setAdapter(ListAdapter adapter) {
mOriginalAdapter = adapter;
if (mHeaderViewInfos.size() > 0 || mFooterViewInfos.size() > 0) {
HeaderViewGridAdapter headerViewGridAdapter = new HeaderViewGridAdapter(mHeaderViewInfos, mFooterViewInfos, adapter);
int numColumns = getNumColumnsCompatible();
Expand All @@ -413,6 +415,14 @@ public void setAdapter(ListAdapter adapter) {
}
}

/**
* Return original adapter for convenience.
* @return
*/
public ListAdapter getOriginalAdapter() {
return mOriginalAdapter;
}

/**
* full width
*/
Expand Down

0 comments on commit 8cca8b4

Please sign in to comment.